]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dxva2_h264.c
avcodec/sheervideo: add interlaced YCbCr(A) 4:2:2:4 8-bit support
[ffmpeg] / libavcodec / dxva2_h264.c
index b1abb9a9af6de584f8044b06939bd66885919cf5..bcba875b7c04d0a8052b6d9113b47bafc0f1a98d 100644 (file)
@@ -228,12 +228,12 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
 
     slice->first_mb_in_slice     = (sl->mb_y >> FIELD_OR_MBAFF_PICTURE(h)) * h->mb_width + sl->mb_x;
     slice->NumMbsForSlice        = 0; /* XXX it is set once we have all slices */
-    slice->BitOffsetToSliceData  = get_bits_count(&sl->gb);
+    slice->BitOffsetToSliceData  = get_bits_count(&sl->gb) - 8;
     slice->slice_type            = ff_h264_get_slice_type(sl);
     if (sl->slice_type_fixed)
         slice->slice_type += 5;
-    slice->luma_log2_weight_denom       = sl->luma_log2_weight_denom;
-    slice->chroma_log2_weight_denom     = sl->chroma_log2_weight_denom;
+    slice->luma_log2_weight_denom       = sl->pwt.luma_log2_weight_denom;
+    slice->chroma_log2_weight_denom     = sl->pwt.chroma_log2_weight_denom;
     if (sl->list_count > 0)
         slice->num_ref_idx_l0_active_minus1 = sl->ref_count[0] - 1;
     if (sl->list_count > 1)
@@ -257,15 +257,15 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
                                    sl->ref_list[list][i].reference == PICT_BOTTOM_FIELD);
                 for (plane = 0; plane < 3; plane++) {
                     int w, o;
-                    if (plane == 0 && sl->luma_weight_flag[list]) {
-                        w = sl->luma_weight[i][list][0];
-                        o = sl->luma_weight[i][list][1];
-                    } else if (plane >= 1 && sl->chroma_weight_flag[list]) {
-                        w = sl->chroma_weight[i][list][plane-1][0];
-                        o = sl->chroma_weight[i][list][plane-1][1];
+                    if (plane == 0 && sl->pwt.luma_weight_flag[list]) {
+                        w = sl->pwt.luma_weight[i][list][0];
+                        o = sl->pwt.luma_weight[i][list][1];
+                    } else if (plane >= 1 && sl->pwt.chroma_weight_flag[list]) {
+                        w = sl->pwt.chroma_weight[i][list][plane-1][0];
+                        o = sl->pwt.chroma_weight[i][list][plane-1][1];
                     } else {
-                        w = 1 << (plane == 0 ? sl->luma_log2_weight_denom :
-                                               sl->chroma_log2_weight_denom);
+                        w = 1 << (plane == 0 ? sl->pwt.luma_log2_weight_denom :
+                                               sl->pwt.chroma_log2_weight_denom);
                         o = 0;
                     }
                     slice->Weights[list][i][plane][0] = w;