diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2004-09-08 17:57:25 +0000 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2004-09-08 17:57:25 +0000 |
commit | b2a1c77162849e43a75910a535a2d2644de73057 (patch) | |
tree | 2138defc59efe6546a47cfaef0a30a0c7ae16fd3 /libavcodec/svq1.c | |
parent | cf7f2b16ddb66c82e09f915ffcb4fe645d0d36c6 (diff) | |
download | ffmpeg-b2a1c77162849e43a75910a535a2d2644de73057.tar.gz |
try to select w/h from tables
Originally committed as revision 3443 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/svq1.c')
-rw-r--r-- | libavcodec/svq1.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/libavcodec/svq1.c b/libavcodec/svq1.c index ae79afef90..448aa93b10 100644 --- a/libavcodec/svq1.c +++ b/libavcodec/svq1.c @@ -880,6 +880,8 @@ static int svq1_decode_end(AVCodecContext *avctx) static void svq1_write_header(SVQ1Context *s, int frame_type) { + int i; + /* frame code */ put_bits(&s->pb, 22, 0x20); @@ -898,12 +900,22 @@ static void svq1_write_header(SVQ1Context *s, int frame_type) /* output 5 unknown bits (2 + 2 + 1) */ put_bits(&s->pb, 5, 0); - /* forget about matching up resolutions, just use the free-form - * resolution code (7) for now */ - put_bits(&s->pb, 3, 7); - put_bits(&s->pb, 12, s->frame_width); - put_bits(&s->pb, 12, s->frame_height); - + for (i = 0; i < 7; i++) + { + if ((svq1_frame_size_table[i].width == s->frame_width) && + (svq1_frame_size_table[i].height == s->frame_height)) + { + put_bits(&s->pb, 3, i); + break; + } + } + + if (i == 7) + { + put_bits(&s->pb, 3, 7); + put_bits(&s->pb, 12, s->frame_width); + put_bits(&s->pb, 12, s->frame_height); + } } /* no checksum or extra data (next 2 bits get 0) */ |