diff mbox series

[FFmpeg-devel,2/6] vaapi_encode_h265: Fix ordering of tile dimensions

Message ID 20200728225025.1830283-2-sw@jkqxz.net
State Accepted
Commit bc58d1f58eeb7f80049b18395256f2a8cb039f64
Headers show
Series [FFmpeg-devel,1/6] vaapi_encode_h265: Remove confusing and redundant tile options
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Mark Thompson July 28, 2020, 10:50 p.m. UTC
Dimensions are normally specified as width x height.

Remove the indirection through the private context at the same time.
---
 doc/encoders.texi              |  2 +-
 libavcodec/vaapi_encode.h      |  2 +-
 libavcodec/vaapi_encode_h265.c | 13 +++----------
 3 files changed, 5 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/doc/encoders.texi b/doc/encoders.texi
index c837e9455a..62258370c6 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -3202,7 +3202,7 @@  messages).
 @end table
 
 @item tiles
-Set the number of tiles to encode the input video with, as rows x columns.
+Set the number of tiles to encode the input video with, as columns x rows.
 Larger numbers allow greater parallelism in both encoding and decoding, but
 may decrease coding efficiency.
 
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h
index 6487a99604..2d71eb0199 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -307,8 +307,8 @@  typedef struct VAAPIEncodeContext {
     int slice_size;
 
     // Tile encoding.
-    int tile_rows;
     int tile_cols;
+    int tile_rows;
     // Tile width of the i-th column.
     int col_width[MAX_TILE_COLS];
     // Tile height of i-th row.
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index 511218f659..04bd2bef1d 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -63,9 +63,6 @@  typedef struct VAAPIEncodeH265Context {
     int level;
     int sei;
 
-    int trows;
-    int tcols;
-
     // Derived settings.
     int fixed_qp_idr;
     int fixed_qp_p;
@@ -1208,11 +1205,6 @@  static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx)
     if (priv->qp > 0)
         ctx->explicit_qp = priv->qp;
 
-    if (priv->trows && priv->tcols) {
-        ctx->tile_rows = priv->trows;
-        ctx->tile_cols = priv->tcols;
-    }
-
     return ff_vaapi_encode_init(avctx);
 }
 
@@ -1289,8 +1281,9 @@  static const AVOption vaapi_encode_h265_options[] = {
       { .i64 = SEI_MASTERING_DISPLAY | SEI_CONTENT_LIGHT_LEVEL },
       INT_MIN, INT_MAX, FLAGS, "sei" },
 
-    { "tiles", "Tile rows x cols",
-      OFFSET(trows), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, 0, FLAGS },
+    { "tiles", "Tile columns x rows",
+      OFFSET(common.tile_cols), AV_OPT_TYPE_IMAGE_SIZE,
+      { .str = NULL }, 0, 0, FLAGS },
 
     { NULL },
 };