X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdnxhddec.c;h=703fb0c1a2965db709f3c0c84b2698081ca3d661;hb=55bf7fb6130a2a13c30498a787d6dfead39ecceb;hp=86dd6088d397cf53f05ee1d5106b40e6345818db;hpb=3c605485bbdfc3a2457821616e691fd2a764af8f;p=ffmpeg diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 86dd6088d39..703fb0c1a29 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -28,23 +28,6 @@ #include "dsputil.h" #include "mpegvideo.h" -typedef struct { - int cid; - unsigned int width, height; - int interlaced; - unsigned int frame_size; - unsigned int coding_unit_size; - int index_bits; - int bit_depth; - const uint8_t *luma_weigth, *chroma_weigth; - const uint8_t *dc_codes, *dc_bits; - const uint16_t *ac_codes; - const uint8_t *ac_bits, *ac_level; - const uint8_t *ac_run_flag, *ac_index_flag; - const uint16_t *run_codes; - const uint8_t *run_bits, *run; -} CIDEntry; - typedef struct { AVCodecContext *avctx; AVFrame picture; @@ -62,30 +45,6 @@ typedef struct { const CIDEntry *cid_table; } DNXHDContext; -static const CIDEntry cid_table[] = { - { 1238, 1920, 1080, 0, 917504, 917504, 4, 8, - dnxhd_1238_luma_weigth, dnxhd_1238_chroma_weigth, - dnxhd_1238_dc_codes, dnxhd_1238_dc_bits, - dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level, - dnxhd_1238_ac_run_flag, dnxhd_1238_ac_index_flag, - dnxhd_1238_run_codes, dnxhd_1238_run_bits, dnxhd_1238_run }, - { 1243, 1920, 1080, 1, 917504, 458752, 4, 8, - dnxhd_1243_luma_weigth, dnxhd_1243_chroma_weigth, - dnxhd_1238_dc_codes, dnxhd_1238_dc_bits, - dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level, - dnxhd_1238_ac_run_flag, dnxhd_1238_ac_index_flag, - dnxhd_1238_run_codes, dnxhd_1238_run_bits, dnxhd_1238_run }, -}; - -static int dnxhd_get_cid_table(int cid) -{ - int i; - for (i = 0; i < sizeof(cid_table)/sizeof(CIDEntry); i++) - if (cid_table[i].cid == cid) - return i; - return -1; -} - #define DNXHD_VLC_BITS 9 #define DNXHD_DC_VLC_BITS 6 @@ -105,11 +64,11 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid) if (!ctx->cid_table) { int index; - if ((index = dnxhd_get_cid_table(cid)) < 0) { + if ((index = ff_dnxhd_get_cid_table(cid)) < 0) { av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid); return -1; } - ctx->cid_table = &cid_table[index]; + ctx->cid_table = &ff_dnxhd_cid_table[index]; init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, ctx->cid_table->ac_bits, 1, 1, ctx->cid_table->ac_codes, 2, 2, 0);