comparison dnxhddec.c @ 5464:75940bbbecfc libavcodec

add coding unit size for interlaced decoding
author bcoudurier
date Sat, 04 Aug 2007 12:59:49 +0000
parents 521465ec12e0
children 6478c562c80f
comparison
equal deleted inserted replaced
5463:521465ec12e0 5464:75940bbbecfc
31 typedef struct { 31 typedef struct {
32 int cid; 32 int cid;
33 unsigned int width, height; 33 unsigned int width, height;
34 int interlaced; 34 int interlaced;
35 unsigned int frame_size; 35 unsigned int frame_size;
36 unsigned int coding_unit_size;
36 int index_bits; 37 int index_bits;
37 int bit_depth; 38 int bit_depth;
38 const uint8_t *luma_weigth, *chroma_weigth; 39 const uint8_t *luma_weigth, *chroma_weigth;
39 const uint8_t *dc_codes, *dc_bits; 40 const uint8_t *dc_codes, *dc_bits;
40 const uint16_t *ac_codes; 41 const uint16_t *ac_codes;
64 DECLARE_ALIGNED_8(ScanTable, scantable); 65 DECLARE_ALIGNED_8(ScanTable, scantable);
65 const CIDEntry *cid_table; 66 const CIDEntry *cid_table;
66 } DNXHDContext; 67 } DNXHDContext;
67 68
68 static const CIDEntry cid_table[] = { 69 static const CIDEntry cid_table[] = {
69 { 1238, 1920, 1080, 0, 917504, 4, 8, 70 { 1238, 1920, 1080, 0, 917504, 917504, 4, 8,
70 dnxhd_1238_luma_weigth, dnxhd_1238_chroma_weigth, 71 dnxhd_1238_luma_weigth, dnxhd_1238_chroma_weigth,
71 dnxhd_1238_dc_codes, dnxhd_1238_dc_bits, 72 dnxhd_1238_dc_codes, dnxhd_1238_dc_bits,
72 dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level, 73 dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level,
73 dnxhd_1238_ac_run_flag, dnxhd_1238_ac_index_flag, 74 dnxhd_1238_ac_run_flag, dnxhd_1238_ac_index_flag,
74 dnxhd_1238_run_codes, dnxhd_1238_run_bits, dnxhd_1238_run }, 75 dnxhd_1238_run_codes, dnxhd_1238_run_bits, dnxhd_1238_run },
75 /* { 1243, 1920, 1080, 1, 917504, 4, 8, */ 76 /* { 1243, 1920, 1080, 1, 917504, 458752, 4, 8, */
76 /* dnxhd_1243_luma_weigth, dnxhd_1243_chroma_weigth, */ 77 /* dnxhd_1243_luma_weigth, dnxhd_1243_chroma_weigth, */
77 /* dnxhd_1238_dc_codes, dnxhd_1238_dc_bits, */ 78 /* dnxhd_1238_dc_codes, dnxhd_1238_dc_bits, */
78 /* dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level, */ 79 /* dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level, */
79 /* dnxhd_1238_ac_run_flag, dnxhd_1238_ac_index_flag, */ 80 /* dnxhd_1238_ac_run_flag, dnxhd_1238_ac_index_flag, */
80 /* dnxhd_1238_run_codes, dnxhd_1238_run_bits, dnxhd_1238_run }, */ 81 /* dnxhd_1238_run_codes, dnxhd_1238_run_bits, dnxhd_1238_run }, */
168 dprintf(ctx->avctx, "compression id %d\n", ctx->cid); 169 dprintf(ctx->avctx, "compression id %d\n", ctx->cid);
169 170
170 if (dnxhd_init_vlc(ctx, ctx->cid) < 0) 171 if (dnxhd_init_vlc(ctx, ctx->cid) < 0)
171 return -1; 172 return -1;
172 173
173 if (buf_size < ctx->cid_table->frame_size) { 174 if (buf_size < ctx->cid_table->coding_unit_size) {
174 av_log(ctx->avctx, AV_LOG_ERROR, "incorrect frame size\n"); 175 av_log(ctx->avctx, AV_LOG_ERROR, "incorrect frame size\n");
175 return -1; 176 return -1;
176 } 177 }
177 178
178 ctx->mb_width = ctx->width>>4; 179 ctx->mb_width = ctx->width>>4;