[FFmpeg-devel] [PATCH] start code detection for hardware decode in mpeg4/divx streams

anuj mittal am.devel at gmail.com
Fri Nov 9 11:28:01 CET 2012


On Mon, Oct 22, 2012 at 8:16 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Mon, Oct 22, 2012 at 02:30:56PM +0530, anuj mittal wrote:
>> On Fri, Oct 19, 2012 at 7:23 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> > On Fri, Oct 19, 2012 at 12:36:53PM +0530, anuj mittal wrote:
>>
>> >>
>> >>  void ff_clean_h263_qscales(MpegEncContext *s);
>> >>  int ff_h263_resync(MpegEncContext *s);
>> >> -const uint8_t *ff_h263_find_resync_marker(MpegEncContext *s, const uint8_t *p, const uint8_t *end);
>> >> +const uint8_t *ff_h263_find_marker(MpegEncContext *s, const uint8_t *p, const uint8_t *end);
>> >
>> > static h263_find_slice_end()
>> >
>> > and the renaming should be in a seperate patch
>>
>> Attached.
>>
>> >
>> >
>> >>  int ff_h263_get_gob_height(MpegEncContext *s);
>> >>  void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code);
>> >>
>> >> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
>> >> index 7141d49..0557fa4 100644
>> >> --- a/libavcodec/h263dec.c
>> >> +++ b/libavcodec/h263dec.c
>> >> @@ -169,10 +169,20 @@ static int decode_slice(MpegEncContext *s){
>> >>      ff_set_qscale(s, s->qscale);
>> >>
>> >>      if (s->avctx->hwaccel) {
>> >> +        int ret;
>> >> +
>> >>          const uint8_t *start= s->gb.buffer + get_bits_count(&s->gb)/8;
>> >> -        const uint8_t *end  = ff_h263_find_resync_marker(s, start + 1, s->gb.buffer_end);
>> >> +        const uint8_t *end  = ff_h263_find_marker(s, start + 1, s->gb.buffer_end);
>> >>          skip_bits_long(&s->gb, 8*(end - start));
>> >> -        return s->avctx->hwaccel->decode_slice(s->avctx, start, end - start);
>> >> +        ret = s->avctx->hwaccel->decode_slice(s->avctx, start, end - start);
>> >> +
>> >
>> >> +        /* Next frame detected */
>> >> +        if (end <= s->gb.buffer_end-2){
>> >> +            if (!end[0] && !end[1] && (end[2] == 1)){
>> >> +                s->mb_y = s->mb_height;
>> >> +            }
>> >> +        }
>> >
>> > that searches for a next startcode not a next frame
>>
>> Right.. had forgotten to change that comment. Attached is the correct
>> version. Thank you.
>
> I think the patches are ok
>
> As this patchset is about VAAPI basically, gwenole can you take a
> look too?

ping


More information about the ffmpeg-devel mailing list