[FFmpeg-devel] [PATCH][H264] Record extra fields for VA API support (take 4)

Michael Niedermayer michaelni
Tue Feb 3 11:44:32 CET 2009


On Tue, Feb 03, 2009 at 11:35:46AM +0100, Gwenole Beauchesne wrote:
> Hi,
>
> On Mon, 2 Feb 2009, Michael Niedermayer wrote:
>
>> as in:
>>                if(   h->luma_weight[list][i] != luma_def
>>                   || h->luma_offset[list][i] != 0){
>>                    h->use_weight= 1;
>> +                   h->luma_weight_flag[list]= 1;
>>                }
>
> Well, the Intel implementation also expects the inferred values with that 
> flag set to 1. Anyway, I was already filling in with the default values in 
> ff_vaapi_h264_decode_slice(). So, the attachment following your suggestion 
> is also right.
[...]
> @@ -2996,6 +2996,8 @@ static int pred_weight_table(H264Context *h){
>      chroma_def = 1<<h->chroma_log2_weight_denom;
>  
>      for(list=0; list<2; list++){
> +        h->luma_weight_flag[list] = 0;
> +        h->chroma_weight_flag[list] = 0;

vertical align


[...]
> @@ -3053,6 +3059,10 @@ static void implicit_weight_table(H264Context *h){
>      h->use_weight_chroma= 2;
>      h->luma_log2_weight_denom= 5;
>      h->chroma_log2_weight_denom= 5;

> +    for (int i = 0; i < 2; i++) {

doesnt compile on gcc-2.95


> +        h->luma_weight_flag[i] = 0;
> +        h->chroma_weight_flag[i] = 0;

vertical align


> +    }
>  
>      for(ref0=0; ref0 < h->ref_count[0]; ref0++){
>          int poc0 = h->ref_list[0][ref0].poc;
> @@ -3938,8 +3948,13 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
>          pred_weight_table(h);
>      else if(h->pps.weighted_bipred_idc==2 && h->slice_type_nos== FF_B_TYPE)
>          implicit_weight_table(h);
> -    else
> +    else {
>          h->use_weight = 0;
> +        for (i = 0; i < 2; i++) {

> +            h->luma_weight_flag[i] = 0;
> +            h->chroma_weight_flag[i] = 0;

vertical align


> +        }
> +    }
>  
>      if(h->nal_ref_idc)
>          decode_ref_pic_marking(h0, &s->gb);
> @@ -7055,9 +7070,9 @@ static inline int decode_seq_parameter_set(H264Context *h){
>      if(sps->profile_idc >= 100){ //high profile
>          sps->chroma_format_idc= get_ue_golomb_31(&s->gb);
>          if(sps->chroma_format_idc == 3)
> -            get_bits1(&s->gb);  //residual_color_transform_flag
> -        get_ue_golomb(&s->gb);  //bit_depth_luma_minus8
> -        get_ue_golomb(&s->gb);  //bit_depth_chroma_minus8

> +            sps->residual_color_transform_flag = get_bits1(&s->gb);

> +        sps->bit_depth_luma_minus8 = get_ue_golomb(&s->gb);
> +        sps->bit_depth_chroma_minus8 = get_ue_golomb(&s->gb);

vertical align


>          sps->transform_bypass = get_bits1(&s->gb);
>          decode_scaling_matrices(h, sps, NULL, 1, sps->scaling_matrix4, sps->scaling_matrix8);
>      }else{
> diff --git a/libavcodec/h264.h b/libavcodec/h264.h
> index 5e879fc..c6753d0 100644
> --- a/libavcodec/h264.h
> +++ b/libavcodec/h264.h
> @@ -176,6 +176,9 @@ typedef struct SPS{
>      int time_offset_length;
>      int cpb_removal_delay_length;      ///< cpb_removal_delay_length_minus1 + 1
>      int dpb_output_delay_length;       ///< dpb_output_delay_length_minus1 + 1

> +    int bit_depth_luma_minus8;         ///< 7.4.2.1.1 bit_depth_luma_minus8
> +    int bit_depth_chroma_minus8;       ///< 7.4.2.1.1 bit_depth_chroma_minus8

remove the _minus8 and store the sane value


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090203/5c540344/attachment.pgp>



More information about the ffmpeg-devel mailing list