aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dnxhddec.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-08-04 13:41:33 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-08-04 13:41:33 +0000
commitd3dc629c62b254a6ad251280c205210b0b607050 (patch)
tree7ca004d3445d2b392d585b480f0eab0f6a6c846e /libavcodec/dnxhddec.c
parent8e2eb3b67496d361bfee6bf7eeb23786e764ebed (diff)
downloadffmpeg-d3dc629c62b254a6ad251280c205210b0b607050.tar.gz
move dnxhd data tables to separate file
Originally committed as revision 9906 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c51
1 files changed, 2 insertions, 49 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 49d54c4074..703fb0c1a2 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -29,23 +29,6 @@
#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;
GetBitContext gb;
@@ -62,36 +45,6 @@ typedef struct {
const CIDEntry *cid_table;
} DNXHDContext;
-static const CIDEntry cid_table[] = {
- { 1237, 1920, 1080, 0, 606208, 606208, 4, 8,
- dnxhd_1237_luma_weigth, dnxhd_1237_chroma_weigth,
- dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
- dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
- dnxhd_1237_ac_run_flag, dnxhd_1237_ac_index_flag,
- dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run },
- { 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
@@ -111,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);