Commit 78b4a80b authored by bcoudurier's avatar bcoudurier

fix and simplify long gop mpeg codec ul computation

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19339 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent c4d12e21
...@@ -1287,24 +1287,18 @@ static const UID mxf_mpeg2_codec_uls[] = { ...@@ -1287,24 +1287,18 @@ static const UID mxf_mpeg2_codec_uls[] = {
static const UID *mxf_get_mpeg2_codec_ul(AVCodecContext *avctx) static const UID *mxf_get_mpeg2_codec_ul(AVCodecContext *avctx)
{ {
int long_gop = avctx->gop_size > 1 || avctx->has_b_frames;
if (avctx->profile == 4) { // Main if (avctx->profile == 4) { // Main
if (avctx->level == 8) // Main if (avctx->level == 8) // Main
return avctx->gop_size ? return &mxf_mpeg2_codec_uls[0+long_gop];
&mxf_mpeg2_codec_uls[1] :
&mxf_mpeg2_codec_uls[0];
else if (avctx->level == 4) // High else if (avctx->level == 4) // High
return avctx->gop_size ? return &mxf_mpeg2_codec_uls[4+long_gop];
&mxf_mpeg2_codec_uls[5] :
&mxf_mpeg2_codec_uls[4];
} else if (avctx->profile == 0) { // 422 } else if (avctx->profile == 0) { // 422
if (avctx->level == 5) // Main if (avctx->level == 5) // Main
return avctx->gop_size ? return &mxf_mpeg2_codec_uls[2+long_gop];
&mxf_mpeg2_codec_uls[3] :
&mxf_mpeg2_codec_uls[2];
else if (avctx->level == 2) // High else if (avctx->level == 2) // High
return avctx->gop_size ? return &mxf_mpeg2_codec_uls[6+long_gop];
&mxf_mpeg2_codec_uls[7] :
&mxf_mpeg2_codec_uls[6];
} }
return NULL; return NULL;
} }
...@@ -1363,7 +1357,6 @@ static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt ...@@ -1363,7 +1357,6 @@ static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt
int pict_type = (pkt->data[i+2]>>3) & 0x07; int pict_type = (pkt->data[i+2]>>3) & 0x07;
if (pict_type == 2) { // P frame if (pict_type == 2) { // P frame
*flags |= 0x22; *flags |= 0x22;
st->codec->gop_size = 1;
sc->closed_gop = 0; // reset closed gop, don't matter anymore sc->closed_gop = 0; // reset closed gop, don't matter anymore
} else if (pict_type == 3) { // B frame } else if (pict_type == 3) { // B frame
if (sc->closed_gop) if (sc->closed_gop)
......
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