aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-08-30 19:40:30 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-08-30 19:40:30 +0000
commitcb231c48667cb9fa71d7f1e0e9e9031db2d20b7f (patch)
tree0bf2e4a4e6638f7383ae636803ecfe15ca064d2c /libavcodec/mpeg12.c
parentdc98fc8d170d7ad072eb87e2fdd546f2bc09ccb4 (diff)
downloadffmpeg-cb231c48667cb9fa71d7f1e0e9e9031db2d20b7f.tar.gz
fixing unused f_code values
10l (forgot to update the regression test scores after the closed gop bit fix) Originally committed as revision 2185 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 713b42d18f..ba352d5c4c 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -392,13 +392,19 @@ void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
// RAL: Forward f_code also needed for B frames
if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) {
put_bits(&s->pb, 1, 0); /* half pel coordinates */
- put_bits(&s->pb, 3, s->f_code); /* forward_f_code */
+ if(s->codec_id == CODEC_ID_MPEG1VIDEO)
+ put_bits(&s->pb, 3, s->f_code); /* forward_f_code */
+ else
+ put_bits(&s->pb, 3, 7); /* forward_f_code */
}
// RAL: Backward f_code necessary for B frames
if (s->pict_type == B_TYPE) {
put_bits(&s->pb, 1, 0); /* half pel coordinates */
- put_bits(&s->pb, 3, s->b_code); /* backward_f_code */
+ if(s->codec_id == CODEC_ID_MPEG1VIDEO)
+ put_bits(&s->pb, 3, s->b_code); /* backward_f_code */
+ else
+ put_bits(&s->pb, 3, 7); /* backward_f_code */
}
put_bits(&s->pb, 1, 0); /* extra bit picture */
@@ -406,10 +412,18 @@ void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
if(s->codec_id == CODEC_ID_MPEG2VIDEO){
put_header(s, EXT_START_CODE);
put_bits(&s->pb, 4, 8); //pic ext
- put_bits(&s->pb, 4, s->f_code);
- put_bits(&s->pb, 4, s->f_code);
- put_bits(&s->pb, 4, s->b_code);
- put_bits(&s->pb, 4, s->b_code);
+ if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) {
+ put_bits(&s->pb, 4, s->f_code);
+ put_bits(&s->pb, 4, s->f_code);
+ }else{
+ put_bits(&s->pb, 8, 255);
+ }
+ if (s->pict_type == B_TYPE) {
+ put_bits(&s->pb, 4, s->b_code);
+ put_bits(&s->pb, 4, s->b_code);
+ }else{
+ put_bits(&s->pb, 8, 255);
+ }
put_bits(&s->pb, 2, s->intra_dc_precision);
put_bits(&s->pb, 2, s->picture_structure= PICT_FRAME);
put_bits(&s->pb, 1, s->top_field_first);