[FFmpeg-devel] [PATCH][VAAPI][4/6] Add MPEG-4 / H.263 bitstream decoding (take 8)

Gwenole Beauchesne gbeauchesne
Mon Mar 30 18:19:46 CEST 2009


On Sun, 29 Mar 2009, Michael Niedermayer wrote:

> On Sun, Mar 29, 2009 at 09:31:21AM +0200, Gwenole Beauchesne wrote:
>> Le 29 mars 09 ? 04:28, Michael Niedermayer a ?crit :
>>
>>>> +/** Reconstruct bitstream intra_dc_vlc_thr */
>>>> +static int mpeg4_get_intra_dc_vlc_thr(MpegEncContext *s)
>>>> +{
>>>> +    int v = 0;
>>>
>>>> +    if (s->shape != 2) { /* video_object_layer_shape != "binary only" */
>>>
>>> binary only shaps work?
>>
>> I am only trying to reconstruct the original intra_dc_vlc_thr syntax
>> element in the bitstream. And AFAICS, this is only defined if not binary
>> shape.
>>
>> That was to save an exra field from MpegEncContext since we don't really
>> have an H263Context to add whatever we want for H.263.
>
> what fails if you remove the check?

My eyes. ;-) I fail to see a difference with the very few samples I have 
but that covers only the H.263 samples from mpq and I did not find any for 
!short-header case. i.e. I just can't say this will really work for all 
samples.

>>>> +    /* Parameters defined by source_format field (Table 6-25) */
>>>> +    const int source_format = h263_get_picture_format(s->width,
>>>> s->height);
>>>> +    static const uint16_t num_macroblocks_in_gob[8] =
>>>> +        { 0, 8, 11, 22, 88, 352, 0, 0 };
>>>> +    static const uint8_t num_gobs_in_vop[8] =
>>>> +        { 0, 6, 9, 18, 18, 18, 0, 0 };
>>>
>>> use mb_height/mb_width please or maybe we have a more fitting field
>>> i dont remember
>>
>> What do you mean?
>
> i mean we have a functioning encoder by that all needed parts must exist
> already, ive now checked and theres ff_h263_get_gob_height() that seems
> what we need.

pic_param->num_macroblocks_in_gob = s->mb_width * ff_h263_get_gob_height(s);
pic_param->num_gobs_in_vop = s->mb_height / ff_h263_get_gob_height(s);
?

>>>> +    pic_param->TRB                                      = 0; /* XXX:
>>>> fill */
>>>> +    pic_param->TRD                                      = 0; /* XXX:
>>>> fill */
>>>
>>> i can only guess what TRB/TRD are supposed to be but 0 is likely not
>>> correct
>>
>> pic_param->TRD = s->picture_structure != PICT_FRAME ? s->pp_field_time : 0;
>> pic_param->TRB = s->picture_structure != PICT_FRAME ? s->pb_field_time : 0;
>> ?
>
> thats the same as 0

Fixed in new attachment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.hwaccel.vaapi.mpeg4.8.patch
Type: text/x-diff
Size: 11507 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090330/5177e1bc/attachment.patch>



More information about the ffmpeg-devel mailing list