Commit 3d390b41 authored by michaelni's avatar michaelni

move scantable init from block-decode to header parser


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@990 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 03dbad35
...@@ -1183,15 +1183,11 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, ...@@ -1183,15 +1183,11 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
{ {
int level, i, j, run; int level, i, j, run;
RLTable *rl = &rl_mpeg1; RLTable *rl = &rl_mpeg1;
UINT8 * scantable; UINT8 * const scantable= s->intra_scantable.permutated;
const UINT16 *quant_matrix; const UINT16 *quant_matrix;
const int qscale= s->qscale; const int qscale= s->qscale;
int mismatch; int mismatch;
if (s->alternate_scan)
scantable = s->intra_v_scantable.permutated;
else
scantable = s->intra_scantable.permutated;
mismatch = 1; mismatch = 1;
{ {
...@@ -1267,16 +1263,11 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, ...@@ -1267,16 +1263,11 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
int level, dc, diff, i, j, run; int level, dc, diff, i, j, run;
int component; int component;
RLTable *rl; RLTable *rl;
UINT8 * scantable; UINT8 * const scantable= s->intra_scantable.permutated;
const UINT16 *quant_matrix; const UINT16 *quant_matrix;
const int qscale= s->qscale; const int qscale= s->qscale;
int mismatch; int mismatch;
if (s->alternate_scan)
scantable = s->intra_v_scantable.permutated;
else
scantable = s->intra_scantable.permutated;
/* DC coef */ /* DC coef */
if (n < 4){ if (n < 4){
quant_matrix = s->intra_matrix; quant_matrix = s->intra_matrix;
...@@ -1524,6 +1515,19 @@ static void mpeg_decode_picture_coding_extension(MpegEncContext *s) ...@@ -1524,6 +1515,19 @@ static void mpeg_decode_picture_coding_extension(MpegEncContext *s)
s->repeat_first_field = get_bits1(&s->gb); s->repeat_first_field = get_bits1(&s->gb);
s->chroma_420_type = get_bits1(&s->gb); s->chroma_420_type = get_bits1(&s->gb);
s->progressive_frame = get_bits1(&s->gb); s->progressive_frame = get_bits1(&s->gb);
if(s->alternate_scan){
ff_init_scantable(s, &s->inter_scantable , ff_alternate_vertical_scan);
ff_init_scantable(s, &s->intra_scantable , ff_alternate_vertical_scan);
ff_init_scantable(s, &s->intra_h_scantable, ff_alternate_vertical_scan);
ff_init_scantable(s, &s->intra_v_scantable, ff_alternate_vertical_scan);
}else{
ff_init_scantable(s, &s->inter_scantable , ff_zigzag_direct);
ff_init_scantable(s, &s->intra_scantable , ff_zigzag_direct);
ff_init_scantable(s, &s->intra_h_scantable, ff_alternate_horizontal_scan);
ff_init_scantable(s, &s->intra_v_scantable, ff_alternate_vertical_scan);
}
/* composite display not parsed */ /* composite display not parsed */
dprintf("intra_dc_precision=%d\n", s->intra_dc_precision); dprintf("intra_dc_precision=%d\n", s->intra_dc_precision);
dprintf("picture_structure=%d\n", s->picture_structure); dprintf("picture_structure=%d\n", s->picture_structure);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment