mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-11 17:20:00 +00:00
avcodec/h261dec: Simplify decoding GOB header
h261_resync() can be completely removed, because h261_decode_gob_header() checks for a GOB header itself if gob_start_code_skipped is zero. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
18b059f208
commit
c1097556c7
@ -165,31 +165,6 @@ static int h261_decode_gob_header(H261DecContext *h)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Decode the group of blocks / video packet header.
|
|
||||||
* @return <0 if no resync found
|
|
||||||
*/
|
|
||||||
static int h261_resync(H261DecContext *h)
|
|
||||||
{
|
|
||||||
MpegEncContext *const s = &h->s;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (h->gob_start_code_skipped) {
|
|
||||||
ret = h261_decode_gob_header(h);
|
|
||||||
if (ret >= 0)
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
if (show_bits(&s->gb, 15) == 0) {
|
|
||||||
ret = h261_decode_gob_header(h);
|
|
||||||
if (ret >= 0)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
// OK, it is not where it is supposed to be ...
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode skipped macroblocks.
|
* Decode skipped macroblocks.
|
||||||
* @return 0
|
* @return 0
|
||||||
@ -626,7 +601,7 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict,
|
|||||||
s->mb_y = 0;
|
s->mb_y = 0;
|
||||||
|
|
||||||
while (h->gob_number < (s->mb_height == 18 ? 12 : 5)) {
|
while (h->gob_number < (s->mb_height == 18 ? 12 : 5)) {
|
||||||
if (h261_resync(h) < 0)
|
if (h261_decode_gob_header(h) < 0)
|
||||||
break;
|
break;
|
||||||
h261_decode_gob(h);
|
h261_decode_gob(h);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user