You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/mpeg4videodec: Split decode_studio_vol_header() out of decode_studiovisualobject()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -2983,18 +2983,26 @@ static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
|
|||||||
static int decode_studiovisualobject(Mpeg4DecContext *ctx, GetBitContext *gb)
|
static int decode_studiovisualobject(Mpeg4DecContext *ctx, GetBitContext *gb)
|
||||||
{
|
{
|
||||||
MpegEncContext *s = &ctx->m;
|
MpegEncContext *s = &ctx->m;
|
||||||
int visual_object_type, width, height;
|
int visual_object_type;
|
||||||
|
|
||||||
skip_bits(gb, 4); /* visual_object_verid */
|
skip_bits(gb, 4); /* visual_object_verid */
|
||||||
visual_object_type = get_bits(gb, 4);
|
visual_object_type = get_bits(gb, 4);
|
||||||
|
if (visual_object_type != VOT_VIDEO_ID) {
|
||||||
|
avpriv_request_sample(s->avctx, "VO type %u", visual_object_type);
|
||||||
|
return AVERROR_PATCHWELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
next_start_code_studio(gb);
|
next_start_code_studio(gb);
|
||||||
extension_and_user_data(s, gb, 1);
|
extension_and_user_data(s, gb, 1);
|
||||||
|
|
||||||
if (visual_object_type == VOT_VIDEO_ID) {
|
return 0;
|
||||||
/* StudioVideoObjectLayer */
|
}
|
||||||
skip_bits_long(gb, 32); /* video_object_start_code */
|
|
||||||
skip_bits_long(gb, 32); /* video_object_layer_start_code */
|
static int decode_studio_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
|
||||||
|
{
|
||||||
|
MpegEncContext *s = &ctx->m;
|
||||||
|
int width, height;
|
||||||
|
|
||||||
skip_bits1(gb); /* random_accessible_vol */
|
skip_bits1(gb); /* random_accessible_vol */
|
||||||
skip_bits(gb, 8); /* video_object_type_indication */
|
skip_bits(gb, 8); /* video_object_type_indication */
|
||||||
skip_bits(gb, 4); /* video_object_layer_verid */
|
skip_bits(gb, 4); /* video_object_layer_verid */
|
||||||
@@ -3063,7 +3071,6 @@ static int decode_studiovisualobject(Mpeg4DecContext *ctx, GetBitContext *gb)
|
|||||||
|
|
||||||
next_start_code_studio(gb);
|
next_start_code_studio(gb);
|
||||||
extension_and_user_data(s, gb, 2);
|
extension_and_user_data(s, gb, 2);
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -3173,8 +3180,14 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
vol++;
|
vol++;
|
||||||
|
if (s->studio_profile) {
|
||||||
|
if ((ret = decode_studio_vol_header(ctx, gb)) < 0)
|
||||||
|
return ret;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
if ((ret = decode_vol_header(ctx, gb)) < 0)
|
if ((ret = decode_vol_header(ctx, gb)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
} else if (startcode == USER_DATA_STARTCODE) {
|
} else if (startcode == USER_DATA_STARTCODE) {
|
||||||
decode_user_data(ctx, gb);
|
decode_user_data(ctx, gb);
|
||||||
} else if (startcode == GOP_STARTCODE) {
|
} else if (startcode == GOP_STARTCODE) {
|
||||||
@@ -3191,7 +3204,6 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb)
|
|||||||
if (s->studio_profile) {
|
if (s->studio_profile) {
|
||||||
if ((ret = decode_studiovisualobject(ctx, gb)) < 0)
|
if ((ret = decode_studiovisualobject(ctx, gb)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
break;
|
|
||||||
} else
|
} else
|
||||||
mpeg4_decode_visual_object(s, gb);
|
mpeg4_decode_visual_object(s, gb);
|
||||||
} else if (startcode == VOP_STARTCODE) {
|
} else if (startcode == VOP_STARTCODE) {
|
||||||
|
Reference in New Issue
Block a user