messages).
@end table
+@item tiles
+Set the number of tiles to encode the input video with, as rows x columns.
+Larger numbers allow greater parallelism in both encoding and decoding, but
+may decrease coding efficiency.
+
+@item tile_rows
+Selects how many rows of tiles to encode with. For example, 4 tile rows would
+be requested by setting the tile_rows option to 4.
+
+@item tile_cols
+Selects how many columns of tiles to encode with. For example, 5 tile columns
+would be requested by setting the tile_cols option to 5.
+
@end table
@item mjpeg_vaapi
int level;
int sei;
+ int trows;
+ int tcols;
+
// Derived settings.
int fixed_qp_idr;
int fixed_qp_p;
level = ff_h265_guess_level(ptl, avctx->bit_rate,
ctx->surface_width, ctx->surface_height,
- ctx->nb_slices, 1, 1,
+ ctx->nb_slices, ctx->tile_rows, ctx->tile_cols,
(ctx->b_per_p > 0) + 1);
if (level) {
av_log(avctx, AV_LOG_VERBOSE, "Using level %s.\n", level->name);
pps->pps_loop_filter_across_slices_enabled_flag = 1;
+ if (ctx->tile_rows && ctx->tile_cols) {
+ pps->tiles_enabled_flag = 1;
+ pps->uniform_spacing_flag = 1;
+
+ pps->num_tile_rows_minus1 = ctx->tile_rows - 1;
+ pps->num_tile_columns_minus1 = ctx->tile_cols - 1;
+
+ pps->loop_filter_across_tiles_enabled_flag = 1;
+
+ for (i = 0; i <= pps->num_tile_rows_minus1; i++)
+ pps->row_height_minus1[i] = ctx->row_height[i] - 1;
+ for (i = 0; i <= pps->num_tile_columns_minus1; i++)
+ pps->column_width_minus1[i] = ctx->col_width[i] - 1;
+ }
// Fill VAAPI parameter buffers.
},
};
+ if (pps->tiles_enabled_flag) {
+ for (i = 0; i <= vpic->num_tile_rows_minus1; i++)
+ vpic->row_height_minus1[i] = pps->row_height_minus1[i];
+ for (i = 0; i <= vpic->num_tile_columns_minus1; i++)
+ vpic->column_width_minus1[i] = pps->column_width_minus1[i];
+ }
+
return 0;
}
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);
}
{ .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 },
+ { "tile_rows", "Number of rows for tile encoding",
+ OFFSET(trows), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
+ { "tile_cols", "Number of cols for tile encoding",
+ OFFSET(tcols), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
+
{ NULL },
};