| Index: source/libvpx/vpx/internal/vpx_codec_internal.h
|
| ===================================================================
|
| --- source/libvpx/vpx/internal/vpx_codec_internal.h (revision 172621)
|
| +++ source/libvpx/vpx/internal/vpx_codec_internal.h (working copy)
|
| @@ -75,7 +75,7 @@
|
| * Memory operation failed.
|
| */
|
| typedef vpx_codec_err_t (*vpx_codec_init_fn_t)(vpx_codec_ctx_t *ctx,
|
| - vpx_codec_priv_enc_mr_cfg_t *data);
|
| + vpx_codec_priv_enc_mr_cfg_t *data);
|
|
|
| /*!\brief destroy function pointer prototype
|
| *
|
| @@ -109,8 +109,8 @@
|
| * Bitstream is parsable and stream information updated
|
| */
|
| typedef vpx_codec_err_t (*vpx_codec_peek_si_fn_t)(const uint8_t *data,
|
| - unsigned int data_sz,
|
| - vpx_codec_stream_info_t *si);
|
| + unsigned int data_sz,
|
| + vpx_codec_stream_info_t *si);
|
|
|
| /*!\brief Return information about the current stream.
|
| *
|
| @@ -126,7 +126,7 @@
|
| * Bitstream is parsable and stream information updated
|
| */
|
| typedef vpx_codec_err_t (*vpx_codec_get_si_fn_t)(vpx_codec_alg_priv_t *ctx,
|
| - vpx_codec_stream_info_t *si);
|
| + vpx_codec_stream_info_t *si);
|
|
|
| /*!\brief control function pointer prototype
|
| *
|
| @@ -151,8 +151,8 @@
|
| * The internal state data was deserialized.
|
| */
|
| typedef vpx_codec_err_t (*vpx_codec_control_fn_t)(vpx_codec_alg_priv_t *ctx,
|
| - int ctrl_id,
|
| - va_list ap);
|
| + int ctrl_id,
|
| + va_list ap);
|
|
|
| /*!\brief control function pointer mapping
|
| *
|
| @@ -165,10 +165,9 @@
|
| * mapping. This implies that ctrl_id values chosen by the algorithm
|
| * \ref MUST be non-zero.
|
| */
|
| -typedef const struct vpx_codec_ctrl_fn_map
|
| -{
|
| - int ctrl_id;
|
| - vpx_codec_control_fn_t fn;
|
| +typedef const struct vpx_codec_ctrl_fn_map {
|
| + int ctrl_id;
|
| + vpx_codec_control_fn_t fn;
|
| } vpx_codec_ctrl_fn_map_t;
|
|
|
| /*!\brief decode data function pointer prototype
|
| @@ -192,10 +191,10 @@
|
| * for recoverability capabilities.
|
| */
|
| typedef vpx_codec_err_t (*vpx_codec_decode_fn_t)(vpx_codec_alg_priv_t *ctx,
|
| - const uint8_t *data,
|
| - unsigned int data_sz,
|
| - void *user_priv,
|
| - long deadline);
|
| + const uint8_t *data,
|
| + unsigned int data_sz,
|
| + void *user_priv,
|
| + long deadline);
|
|
|
| /*!\brief Decoded frames iterator
|
| *
|
| @@ -212,8 +211,8 @@
|
| * \return Returns a pointer to an image, if one is ready for display. Frames
|
| * produced will always be in PTS (presentation time stamp) order.
|
| */
|
| -typedef vpx_image_t*(*vpx_codec_get_frame_fn_t)(vpx_codec_alg_priv_t *ctx,
|
| - vpx_codec_iter_t *iter);
|
| +typedef vpx_image_t *(*vpx_codec_get_frame_fn_t)(vpx_codec_alg_priv_t *ctx,
|
| + vpx_codec_iter_t *iter);
|
|
|
|
|
| /*\brief eXternal Memory Allocation memory map get iterator
|
| @@ -228,8 +227,8 @@
|
| * indicate end-of-list.
|
| */
|
| typedef vpx_codec_err_t (*vpx_codec_get_mmap_fn_t)(const vpx_codec_ctx_t *ctx,
|
| - vpx_codec_mmap_t *mmap,
|
| - vpx_codec_iter_t *iter);
|
| + vpx_codec_mmap_t *mmap,
|
| + vpx_codec_iter_t *iter);
|
|
|
|
|
| /*\brief eXternal Memory Allocation memory map set iterator
|
| @@ -245,17 +244,17 @@
|
| * The memory map was rejected.
|
| */
|
| typedef vpx_codec_err_t (*vpx_codec_set_mmap_fn_t)(vpx_codec_ctx_t *ctx,
|
| - const vpx_codec_mmap_t *mmap);
|
| + const vpx_codec_mmap_t *mmap);
|
|
|
|
|
| typedef vpx_codec_err_t (*vpx_codec_encode_fn_t)(vpx_codec_alg_priv_t *ctx,
|
| - const vpx_image_t *img,
|
| - vpx_codec_pts_t pts,
|
| - unsigned long duration,
|
| - vpx_enc_frame_flags_t flags,
|
| - unsigned long deadline);
|
| -typedef const vpx_codec_cx_pkt_t*(*vpx_codec_get_cx_data_fn_t)(vpx_codec_alg_priv_t *ctx,
|
| - vpx_codec_iter_t *iter);
|
| + const vpx_image_t *img,
|
| + vpx_codec_pts_t pts,
|
| + unsigned long duration,
|
| + vpx_enc_frame_flags_t flags,
|
| + unsigned long deadline);
|
| +typedef const vpx_codec_cx_pkt_t *(*vpx_codec_get_cx_data_fn_t)(vpx_codec_alg_priv_t *ctx,
|
| + vpx_codec_iter_t *iter);
|
|
|
| typedef vpx_codec_err_t
|
| (*vpx_codec_enc_config_set_fn_t)(vpx_codec_alg_priv_t *ctx,
|
| @@ -268,7 +267,7 @@
|
|
|
| typedef vpx_codec_err_t
|
| (*vpx_codec_enc_mr_get_mem_loc_fn_t)(const vpx_codec_enc_cfg_t *cfg,
|
| - void **mem_loc);
|
| + void **mem_loc);
|
|
|
| /*!\brief usage configuration mapping
|
| *
|
| @@ -280,10 +279,9 @@
|
| * one mapping must be present, in addition to the end-of-list.
|
| *
|
| */
|
| -typedef const struct vpx_codec_enc_cfg_map
|
| -{
|
| - int usage;
|
| - vpx_codec_enc_cfg_t cfg;
|
| +typedef const struct vpx_codec_enc_cfg_map {
|
| + int usage;
|
| + vpx_codec_enc_cfg_t cfg;
|
| } vpx_codec_enc_cfg_map_t;
|
|
|
| #define NOT_IMPLEMENTED 0
|
| @@ -292,44 +290,39 @@
|
| *
|
| * All decoders \ref MUST expose a variable of this type.
|
| */
|
| -struct vpx_codec_iface
|
| -{
|
| - const char *name; /**< Identification String */
|
| - int abi_version; /**< Implemented ABI version */
|
| - vpx_codec_caps_t caps; /**< Decoder capabilities */
|
| - vpx_codec_init_fn_t init; /**< \copydoc ::vpx_codec_init_fn_t */
|
| - vpx_codec_destroy_fn_t destroy; /**< \copydoc ::vpx_codec_destroy_fn_t */
|
| - vpx_codec_ctrl_fn_map_t *ctrl_maps; /**< \copydoc ::vpx_codec_ctrl_fn_map_t */
|
| - vpx_codec_get_mmap_fn_t get_mmap; /**< \copydoc ::vpx_codec_get_mmap_fn_t */
|
| - vpx_codec_set_mmap_fn_t set_mmap; /**< \copydoc ::vpx_codec_set_mmap_fn_t */
|
| - struct vpx_codec_dec_iface
|
| - {
|
| - vpx_codec_peek_si_fn_t peek_si; /**< \copydoc ::vpx_codec_peek_si_fn_t */
|
| - vpx_codec_get_si_fn_t get_si; /**< \copydoc ::vpx_codec_peek_si_fn_t */
|
| - vpx_codec_decode_fn_t decode; /**< \copydoc ::vpx_codec_decode_fn_t */
|
| - vpx_codec_get_frame_fn_t get_frame; /**< \copydoc ::vpx_codec_get_frame_fn_t */
|
| - } dec;
|
| - struct vpx_codec_enc_iface
|
| - {
|
| - vpx_codec_enc_cfg_map_t *cfg_maps; /**< \copydoc ::vpx_codec_enc_cfg_map_t */
|
| - vpx_codec_encode_fn_t encode; /**< \copydoc ::vpx_codec_encode_fn_t */
|
| - vpx_codec_get_cx_data_fn_t get_cx_data; /**< \copydoc ::vpx_codec_get_cx_data_fn_t */
|
| - vpx_codec_enc_config_set_fn_t cfg_set; /**< \copydoc ::vpx_codec_enc_config_set_fn_t */
|
| - vpx_codec_get_global_headers_fn_t get_glob_hdrs; /**< \copydoc ::vpx_codec_get_global_headers_fn_t */
|
| - vpx_codec_get_preview_frame_fn_t get_preview; /**< \copydoc ::vpx_codec_get_preview_frame_fn_t */
|
| - vpx_codec_enc_mr_get_mem_loc_fn_t mr_get_mem_loc; /**< \copydoc ::vpx_codec_enc_mr_get_mem_loc_fn_t */
|
| - } enc;
|
| +struct vpx_codec_iface {
|
| + const char *name; /**< Identification String */
|
| + int abi_version; /**< Implemented ABI version */
|
| + vpx_codec_caps_t caps; /**< Decoder capabilities */
|
| + vpx_codec_init_fn_t init; /**< \copydoc ::vpx_codec_init_fn_t */
|
| + vpx_codec_destroy_fn_t destroy; /**< \copydoc ::vpx_codec_destroy_fn_t */
|
| + vpx_codec_ctrl_fn_map_t *ctrl_maps; /**< \copydoc ::vpx_codec_ctrl_fn_map_t */
|
| + vpx_codec_get_mmap_fn_t get_mmap; /**< \copydoc ::vpx_codec_get_mmap_fn_t */
|
| + vpx_codec_set_mmap_fn_t set_mmap; /**< \copydoc ::vpx_codec_set_mmap_fn_t */
|
| + struct vpx_codec_dec_iface {
|
| + vpx_codec_peek_si_fn_t peek_si; /**< \copydoc ::vpx_codec_peek_si_fn_t */
|
| + vpx_codec_get_si_fn_t get_si; /**< \copydoc ::vpx_codec_peek_si_fn_t */
|
| + vpx_codec_decode_fn_t decode; /**< \copydoc ::vpx_codec_decode_fn_t */
|
| + vpx_codec_get_frame_fn_t get_frame; /**< \copydoc ::vpx_codec_get_frame_fn_t */
|
| + } dec;
|
| + struct vpx_codec_enc_iface {
|
| + vpx_codec_enc_cfg_map_t *cfg_maps; /**< \copydoc ::vpx_codec_enc_cfg_map_t */
|
| + vpx_codec_encode_fn_t encode; /**< \copydoc ::vpx_codec_encode_fn_t */
|
| + vpx_codec_get_cx_data_fn_t get_cx_data; /**< \copydoc ::vpx_codec_get_cx_data_fn_t */
|
| + vpx_codec_enc_config_set_fn_t cfg_set; /**< \copydoc ::vpx_codec_enc_config_set_fn_t */
|
| + vpx_codec_get_global_headers_fn_t get_glob_hdrs; /**< \copydoc ::vpx_codec_get_global_headers_fn_t */
|
| + vpx_codec_get_preview_frame_fn_t get_preview; /**< \copydoc ::vpx_codec_get_preview_frame_fn_t */
|
| + vpx_codec_enc_mr_get_mem_loc_fn_t mr_get_mem_loc; /**< \copydoc ::vpx_codec_enc_mr_get_mem_loc_fn_t */
|
| + } enc;
|
| };
|
|
|
| /*!\brief Callback function pointer / user data pair storage */
|
| -typedef struct vpx_codec_priv_cb_pair
|
| -{
|
| - union
|
| - {
|
| - vpx_codec_put_frame_cb_fn_t put_frame;
|
| - vpx_codec_put_slice_cb_fn_t put_slice;
|
| - } u;
|
| - void *user_priv;
|
| +typedef struct vpx_codec_priv_cb_pair {
|
| + union {
|
| + vpx_codec_put_frame_cb_fn_t put_frame;
|
| + vpx_codec_put_slice_cb_fn_t put_slice;
|
| + } u;
|
| + void *user_priv;
|
| } vpx_codec_priv_cb_pair_t;
|
|
|
|
|
| @@ -341,27 +334,24 @@
|
| * structure can be made the first member of the algorithm specific structure,
|
| * and the pointer cast to the proper type.
|
| */
|
| -struct vpx_codec_priv
|
| -{
|
| - unsigned int sz;
|
| - vpx_codec_iface_t *iface;
|
| - struct vpx_codec_alg_priv *alg_priv;
|
| - const char *err_detail;
|
| - vpx_codec_flags_t init_flags;
|
| - struct
|
| - {
|
| - vpx_codec_priv_cb_pair_t put_frame_cb;
|
| - vpx_codec_priv_cb_pair_t put_slice_cb;
|
| - } dec;
|
| - struct
|
| - {
|
| - int tbd;
|
| - struct vpx_fixed_buf cx_data_dst_buf;
|
| - unsigned int cx_data_pad_before;
|
| - unsigned int cx_data_pad_after;
|
| - vpx_codec_cx_pkt_t cx_data_pkt;
|
| - unsigned int total_encoders;
|
| - } enc;
|
| +struct vpx_codec_priv {
|
| + unsigned int sz;
|
| + vpx_codec_iface_t *iface;
|
| + struct vpx_codec_alg_priv *alg_priv;
|
| + const char *err_detail;
|
| + vpx_codec_flags_t init_flags;
|
| + struct {
|
| + vpx_codec_priv_cb_pair_t put_frame_cb;
|
| + vpx_codec_priv_cb_pair_t put_slice_cb;
|
| + } dec;
|
| + struct {
|
| + int tbd;
|
| + struct vpx_fixed_buf cx_data_dst_buf;
|
| + unsigned int cx_data_pad_before;
|
| + unsigned int cx_data_pad_after;
|
| + vpx_codec_cx_pkt_t cx_data_pkt;
|
| + unsigned int total_encoders;
|
| + } enc;
|
| };
|
|
|
| /*
|
| @@ -377,32 +367,32 @@
|
|
|
| #undef VPX_CTRL_USE_TYPE
|
| #define VPX_CTRL_USE_TYPE(id, typ) \
|
| - static typ id##__value(va_list args) {return va_arg(args, typ);} \
|
| - static typ id##__convert(void *x)\
|
| + static typ id##__value(va_list args) {return va_arg(args, typ);} \
|
| + static typ id##__convert(void *x)\
|
| + {\
|
| + union\
|
| {\
|
| - union\
|
| - {\
|
| - void *x;\
|
| - typ d;\
|
| - } u;\
|
| - u.x = x;\
|
| - return u.d;\
|
| - }
|
| + void *x;\
|
| + typ d;\
|
| + } u;\
|
| + u.x = x;\
|
| + return u.d;\
|
| + }
|
|
|
|
|
| #undef VPX_CTRL_USE_TYPE_DEPRECATED
|
| #define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \
|
| - static typ id##__value(va_list args) {return va_arg(args, typ);} \
|
| - static typ id##__convert(void *x)\
|
| + static typ id##__value(va_list args) {return va_arg(args, typ);} \
|
| + static typ id##__convert(void *x)\
|
| + {\
|
| + union\
|
| {\
|
| - union\
|
| - {\
|
| - void *x;\
|
| - typ d;\
|
| - } u;\
|
| - u.x = x;\
|
| - return u.d;\
|
| - }
|
| + void *x;\
|
| + typ d;\
|
| + } u;\
|
| + u.x = x;\
|
| + return u.d;\
|
| + }
|
|
|
| #define CAST(id, arg) id##__value(arg)
|
| #define RECAST(id, x) id##__convert(x)
|
| @@ -418,8 +408,8 @@
|
| * macro is provided to define this getter function automatically.
|
| */
|
| #define CODEC_INTERFACE(id)\
|
| -vpx_codec_iface_t* id(void) { return &id##_algo; }\
|
| -vpx_codec_iface_t id##_algo
|
| + vpx_codec_iface_t* id(void) { return &id##_algo; }\
|
| + vpx_codec_iface_t id##_algo
|
|
|
|
|
| /* Internal Utility Functions
|
| @@ -427,64 +417,60 @@
|
| * The following functions are intended to be used inside algorithms as
|
| * utilities for manipulating vpx_codec_* data structures.
|
| */
|
| -struct vpx_codec_pkt_list
|
| -{
|
| - unsigned int cnt;
|
| - unsigned int max;
|
| - struct vpx_codec_cx_pkt pkts[1];
|
| +struct vpx_codec_pkt_list {
|
| + unsigned int cnt;
|
| + unsigned int max;
|
| + struct vpx_codec_cx_pkt pkts[1];
|
| };
|
|
|
| #define vpx_codec_pkt_list_decl(n)\
|
| - union {struct vpx_codec_pkt_list head;\
|
| - struct {struct vpx_codec_pkt_list head;\
|
| - struct vpx_codec_cx_pkt pkts[n];} alloc;}
|
| + union {struct vpx_codec_pkt_list head;\
|
| + struct {struct vpx_codec_pkt_list head;\
|
| + struct vpx_codec_cx_pkt pkts[n];} alloc;}
|
|
|
| #define vpx_codec_pkt_list_init(m)\
|
| - (m)->alloc.head.cnt = 0,\
|
| - (m)->alloc.head.max = sizeof((m)->alloc.pkts) / sizeof((m)->alloc.pkts[0])
|
| + (m)->alloc.head.cnt = 0,\
|
| + (m)->alloc.head.max = sizeof((m)->alloc.pkts) / sizeof((m)->alloc.pkts[0])
|
|
|
| int
|
| vpx_codec_pkt_list_add(struct vpx_codec_pkt_list *,
|
| const struct vpx_codec_cx_pkt *);
|
|
|
| -const vpx_codec_cx_pkt_t*
|
| +const vpx_codec_cx_pkt_t *
|
| vpx_codec_pkt_list_get(struct vpx_codec_pkt_list *list,
|
| vpx_codec_iter_t *iter);
|
|
|
|
|
| #include <stdio.h>
|
| #include <setjmp.h>
|
| -struct vpx_internal_error_info
|
| -{
|
| - vpx_codec_err_t error_code;
|
| - int has_detail;
|
| - char detail[80];
|
| - int setjmp;
|
| - jmp_buf jmp;
|
| +struct vpx_internal_error_info {
|
| + vpx_codec_err_t error_code;
|
| + int has_detail;
|
| + char detail[80];
|
| + int setjmp;
|
| + jmp_buf jmp;
|
| };
|
|
|
| static void vpx_internal_error(struct vpx_internal_error_info *info,
|
| vpx_codec_err_t error,
|
| const char *fmt,
|
| - ...)
|
| -{
|
| - va_list ap;
|
| + ...) {
|
| + va_list ap;
|
|
|
| - info->error_code = error;
|
| - info->has_detail = 0;
|
| + info->error_code = error;
|
| + info->has_detail = 0;
|
|
|
| - if (fmt)
|
| - {
|
| - size_t sz = sizeof(info->detail);
|
| + if (fmt) {
|
| + size_t sz = sizeof(info->detail);
|
|
|
| - info->has_detail = 1;
|
| - va_start(ap, fmt);
|
| - vsnprintf(info->detail, sz - 1, fmt, ap);
|
| - va_end(ap);
|
| - info->detail[sz-1] = '\0';
|
| - }
|
| + info->has_detail = 1;
|
| + va_start(ap, fmt);
|
| + vsnprintf(info->detail, sz - 1, fmt, ap);
|
| + va_end(ap);
|
| + info->detail[sz - 1] = '\0';
|
| + }
|
|
|
| - if (info->setjmp)
|
| - longjmp(info->jmp, info->error_code);
|
| + if (info->setjmp)
|
| + longjmp(info->jmp, info->error_code);
|
| }
|
| #endif
|
|
|