[FFmpeg-devel] [PATCH][VAAPI][5/6] Add VC-1 bitstream decoding (take 4)

Gwenole Beauchesne gbeauchesne
Sun Mar 22 10:42:58 CET 2009


Le 22 mars 09 ? 06:23, Kostya a ?crit :

> [...]
>> +
>> +/** Checks whether the SKIPMB bitplane is present */
>> +static inline int vc1_has_SKIPMB_bitplane(VC1Context *v)
>> +{
>> +    return (v->s.pict_type == FF_P_TYPE || v->s.pict_type ==  
>> FF_B_TYPE);
>> +}
>> +
>> +/** Checks whether the DIRECTMB bitplane is present */
>> +static inline int vc1_has_DIRECTMB_bitplane(VC1Context *v)
>> +{
>> +    return v->s.pict_type == FF_B_TYPE;
>> +}
>> +
>> +/** Checks whether the ACPRED bitplane is present */
>> +static inline int vc1_has_ACPRED_bitplane(VC1Context *v)
>> +{
>> +    return (v->profile == PROFILE_ADVANCED &&
>> +            (v->s.pict_type == FF_I_TYPE || v->s.pict_type ==  
>> FF_BI_TYPE));
>> +}
>> +
>> +/** Check whether the OVERFLAGS bitplane is present */
>> +static inline int vc1_has_OVERFLAGS_bitplane(VC1Context *v)
>> +{
>> +    return (v->profile == PROFILE_ADVANCED &&
>> +            (v->s.pict_type == FF_I_TYPE || v->s.pict_type ==  
>> FF_BI_TYPE) &&
>> +            (v->overlap && v->pq <= 8) &&
>> +            v->condover == CONDOVER_SELECT);
>> +}
>
> Hmm, does that indicate cases where bitplane MAY be present or where  
> it is decoded
> explicitly (any bitplane may be coded as a bit in each macroblock  
> header instead)?

Those are cases where bitplane_decoding() were explicitly called. I  
just copy-pasted the conditions that reached to each individual  
bitplane_decoding() function call.

Now, something not exactly related but I just remembered that you once  
told me pict_type can't be FF_BI_TYPE at the point where start_frame()  
is called. I will try to fix that for the next iteration. It seems  
current vdpau.c code is also affected by this.

>> +/** Reconstruct bitstream PTYPE (7.1.1.4) */
>> +static int vc1_get_PTYPE(VC1Context *v)
>> +{
>> +    MpegEncContext * const s = &v->s;
>> +    switch (s->pict_type) {
>> +    case FF_I_TYPE:     return 0;
>> +    case FF_P_TYPE:     return v->p_frame_skipped ? 4 : 1;
>> +    case FF_B_TYPE:     return v->bi_type ? 3 : 2;
>> +    }
>> +    assert(0);
>> +    return 0;
>> +}
>
> No enums here?

The values are exactly those of Table-35, I may have to precise this  
in the comment. Is this OK that way? There is not enum from VA API.



More information about the ffmpeg-devel mailing list