aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-10-01 23:47:04 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-10-01 23:47:04 +0000
commitacf44abb8cb7e09904081d4e74a6d7de18af5c27 (patch)
tree53f028e4ec2388d329a44b39ac82aafbb0b981f2 /libavcodec
parent3729c91296264edfd47e78dddcab59fa09e29317 (diff)
downloadffmpeg-acf44abb8cb7e09904081d4e74a6d7de18af5c27.tar.gz
move scantable init from block-decode to header parser
Originally committed as revision 990 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpeg12.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 89f24c4ee6..e43525e4e9 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1183,15 +1183,11 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
{
int level, i, j, run;
RLTable *rl = &rl_mpeg1;
- UINT8 * scantable;
+ UINT8 * const scantable= s->intra_scantable.permutated;
const UINT16 *quant_matrix;
const int qscale= s->qscale;
int mismatch;
- if (s->alternate_scan)
- scantable = s->intra_v_scantable.permutated;
- else
- scantable = s->intra_scantable.permutated;
mismatch = 1;
{
@@ -1267,16 +1263,11 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
int level, dc, diff, i, j, run;
int component;
RLTable *rl;
- UINT8 * scantable;
+ UINT8 * const scantable= s->intra_scantable.permutated;
const UINT16 *quant_matrix;
const int qscale= s->qscale;
int mismatch;
- if (s->alternate_scan)
- scantable = s->intra_v_scantable.permutated;
- else
- scantable = s->intra_scantable.permutated;
-
/* DC coef */
if (n < 4){
quant_matrix = s->intra_matrix;
@@ -1524,6 +1515,19 @@ static void mpeg_decode_picture_coding_extension(MpegEncContext *s)
s->repeat_first_field = get_bits1(&s->gb);
s->chroma_420_type = 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 */
dprintf("intra_dc_precision=%d\n", s->intra_dc_precision);
dprintf("picture_structure=%d\n", s->picture_structure);