summaryrefslogtreecommitdiff
path: root/libavcodec/ituh263dec.c
diff options
context:
space:
mode:
authorKieran Kunhya <kierank@obe.tv>2017-12-29 15:42:14 +0000
committerKieran Kunhya <kierank@obe.tv>2018-04-02 13:06:23 +0100
commitf9d3841ae6147eaa51c57c574cd81e9ce9566e3a (patch)
treedd24a952bd115ed8596b952999aad07dcc36742e /libavcodec/ituh263dec.c
parent699fa8f382704acdbdf720042dd7b21df2eb7558 (diff)
mpeg4video: Add support for MPEG-4 Simple Studio Profile.
This is a profile supporting > 8-bit video and has a higher quality DCT
Diffstat (limited to 'libavcodec/ituh263dec.c')
-rw-r--r--libavcodec/ituh263dec.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index fc95a532ce..1b57e53cad 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -207,12 +207,27 @@ static int h263_decode_gob_header(MpegEncContext *s)
}
/**
- * Decode the group of blocks / video packet header.
+ * Decode the group of blocks / video packet header / slice header (MPEG-4 Studio).
* @return bit position of the resync_marker, or <0 if none was found
*/
int ff_h263_resync(MpegEncContext *s){
int left, pos, ret;
+ /* In MPEG-4 studio mode look for a new slice startcode
+ * and decode slice header */
+ if(s->codec_id==AV_CODEC_ID_MPEG4 && s->studio_profile) {
+ align_get_bits(&s->gb);
+
+ while (get_bits_left(&s->gb) >= 32 && show_bits_long(&s->gb, 32) != SLICE_START_CODE) {
+ get_bits(&s->gb, 8);
+ }
+
+ if (show_bits_long(&s->gb, 32) == SLICE_START_CODE)
+ return get_bits_count(&s->gb);
+ else
+ return -1;
+ }
+
if(s->codec_id==AV_CODEC_ID_MPEG4){
skip_bits1(&s->gb);
align_get_bits(&s->gb);