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

Gwenole Beauchesne gbeauchesne
Tue Mar 31 15:24:31 CEST 2009


Le 30 mars 09 ? 18:19, Gwenole Beauchesne a ?crit :

> 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.

Here is a new patch with the check removed, though I am still not very  
satisfied with that removal: the HW doesn't know about the shape.

>>>>> +    /* 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);
> ?

Changed the last line to:
pic_param->num_gobs_in_vop = (s->mb_width * s->mb_height) / pic_param- 
 >num_macroblocks_in_gob;
which should be more abvious than the previous "simplification".

Only tested with 352x288 clips, did not find any larger ones.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.hwaccel.vaapi.mpeg4.9.patch
Type: application/octet-stream
Size: 10851 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090331/5be20c6b/attachment.obj>
-------------- next part --------------






More information about the ffmpeg-devel mailing list