aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-24 01:04:14 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-24 01:04:14 +0200
commitfe906830fd58cd281bc94c59081f66074ea69dff (patch)
tree0739de4ffbcdae3ca1a1ad72bf457c0170c54c01
parent2b0cdb7364fbe1e8a7e97d36ba36dc67fb24095e (diff)
downloadffmpeg-fe906830fd58cd281bc94c59081f66074ea69dff.tar.gz
Revert "mpeg12: move closed_gop from MpegEncContext to Mpeg1Context"
This reverts commit 3fc08304322ce3ed0e4a71efde78ae5e0d5c910c. The revert is done because the reasoning behind the commit was flawed, closed_gop is not mpeg1/2 specific. Conflicts: libavcodec/mpeg12.c libavcodec/mpeg12.h
-rw-r--r--libavcodec/mpeg12.c5
-rw-r--r--libavcodec/mpeg12.h1
-rw-r--r--libavcodec/mpegvideo.c1
-rw-r--r--libavcodec/mpegvideo.h1
4 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index b5dfc42cc7..68d44673d0 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2158,7 +2158,7 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
time_code_seconds = get_bits(&s->gb, 6);
time_code_pictures = get_bits(&s->gb, 6);
- s1->closed_gop = get_bits1(&s->gb);
+ s->closed_gop = get_bits1(&s->gb);
/*broken_link indicate that after editing the
reference frames of the first B-Frames after GOP I-Frame
are missing (open gop)*/
@@ -2438,7 +2438,7 @@ static int decode_chunks(AVCodecContext *avctx,
if (s2->last_picture_ptr == NULL) {
/* Skip B-frames if we do not have reference frames and gop is not closed */
if (s2->pict_type == AV_PICTURE_TYPE_B) {
- if (!s->closed_gop)
+ if (!s2->closed_gop)
break;
}
}
@@ -2523,7 +2523,6 @@ static void flush(AVCodecContext *avctx)
Mpeg1Context *s = avctx->priv_data;
s->sync=0;
- s->closed_gop = 0;
ff_mpeg_flush(avctx);
}
diff --git a/libavcodec/mpeg12.h b/libavcodec/mpeg12.h
index 2f75d39454..89db30b18f 100644
--- a/libavcodec/mpeg12.h
+++ b/libavcodec/mpeg12.h
@@ -42,7 +42,6 @@ typedef struct Mpeg1Context {
AVRational frame_rate_ext; ///< MPEG-2 specific framerate modificator
int sync; ///< Did we reach a sync point like a GOP/SEQ/KEYFrame?
int full_pel[2];
- int closed_gop; ///< GOP is closed
int tmpgexs;
} Mpeg1Context;
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 69dec5f11d..fffa36a456 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2425,6 +2425,7 @@ void ff_mpeg_flush(AVCodecContext *avctx){
s->current_picture_ptr = s->last_picture_ptr = s->next_picture_ptr = NULL;
s->mb_x= s->mb_y= 0;
+ s->closed_gop= 0;
s->parse_context.state= -1;
s->parse_context.frame_start_found= 0;
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 93839e1f89..a8aef0ca48 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -331,6 +331,7 @@ typedef struct MpegEncContext {
int *lambda_table;
int adaptive_quant; ///< use adaptive quantization
int dquant; ///< qscale difference to prev qscale
+ int closed_gop; ///< MPEG1/2 GOP is closed
int pict_type; ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
int last_pict_type; //FIXME removes
int last_non_b_pict_type; ///< used for mpeg4 gmc b-frames & ratecontrol