gallium/va: fix superres av1 decoding.
authorDave Airlie <airlied@redhat.com>
Wed, 14 Jun 2023 20:05:44 +0000 (06:05 +1000)
committerMarge Bot <emma+marge@anholt.net>
Mon, 10 Jul 2023 21:15:19 +0000 (21:15 +0000)
On a superres sample, vulkan was decoding fine, but vaapi failed,
fix the micols calculations.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23715>

src/gallium/frontends/va/picture_av1.c

index e642b3c..1f6a949 100644 (file)
@@ -51,6 +51,12 @@ static void tile_info(vlVaContext *context, VADecPictureParameterBufferAV1 *av1)
    unsigned TileColsLog2 = util_logbase2_ceil(av1->tile_cols);
    unsigned TileRowsLog2 = util_logbase2_ceil(av1->tile_rows);
 
+   if (av1->pic_info_fields.bits.use_superres) {
+      unsigned width = ((av1->frame_width_minus1 + 1) * 8 + av1->superres_scale_denominator / 2)
+         / av1->superres_scale_denominator;
+      MiCols = 2 * (((width - 1) + 8) >> 3);
+   }
+
    sbCols = (av1->seq_info_fields.fields.use_128x128_superblock) ?
       ((MiCols + 31) >> 5) : ((MiCols + 15) >> 4);
    sbRows = (av1->seq_info_fields.fields.use_128x128_superblock) ?