[FFmpeg-devel] [PATCH v2 1/3] libaomenc: Add support for tiles

James Almer jamrial at gmail.com
Wed Sep 19 02:15:41 EEST 2018


On 9/18/2018 7:55 PM, Mark Thompson wrote:
> On 18/09/18 01:12, James Almer wrote:
>> On 9/17/2018 8:47 PM, Mark Thompson wrote:
>>> Adds an option to specify the number of tile rows and columns, then uses
>>> equal-sized tiles to fill the frame.
>>> ---
>>>  libavcodec/libaomenc.c | 54 ++++++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 54 insertions(+)
>>>
>>> diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
>>> index 6a79d9b873..3ccff0e0fb 100644
>>> --- a/libavcodec/libaomenc.c
>>> +++ b/libavcodec/libaomenc.c
>>> ...
>>> @@ -742,6 +795,7 @@ static const AVOption options[] = {
>>>      { "static-thresh",    "A change threshold on blocks below which they will be skipped by the encoder", OFFSET(static_thresh), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
>>>      { "drop-threshold",   "Frame drop threshold", offsetof(AOMContext, drop_threshold), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, VE },
>>>      { "noise-sensitivity", "Noise sensitivity", OFFSET(noise_sensitivity), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 4, VE},
>>> +    { "tiles",            "Tile rows x columns", OFFSET(tile_cols), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, 0, VE },
>>
>> Using separate tile-columns and tile-rows AV_OPT_TYPE_INT options would
>> be more consistent with the libvpx wrapper, which already has them
>> called like that and also shares a lot of other option names with the
>> libaom.
> 
> The options on libvpx-vp9 are actually log2 of the value, so "-tile-rows 3 -tile-columns 2" gives you 8x4 tiles.  (VP9 requires that the number of tiles in each dimension is a power of two, while AV1 lets you set arbitrary sizes.)
> 
> I don't really mind how this works - I just thought the IMAGE_SIZE method looked nicer.  What do you prefer?

I usually prefer consistency in options for similar modules, but the
equivalent of the VP9 options would be to set the AV1E_SET_TILE_* codec
control IDs instead of what you're doing here, so your IMAGE_SIZE method
is fine.

There's for that matter a conflicting patch called "lavc/libaomenc: Add
-tile-columns/-tile-rows" by Kagami Hiiragi that sets the aforementioned
codec control IDs with the same option names as the VP9 ones. Maybe both
patches can be applied, and have the encoder abort if they are used at
the same time? Otherwise apply yours alone since it allows arbitrary sizes.

> 
> - Mark
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 



More information about the ffmpeg-devel mailing list