Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-25 Thread James Almer
On 1/25/2024 2:13 PM, Anton Khirnov wrote: Quoting James Almer (2024-01-22 12:59:52) I don't see how is that supposed to work. E.g. consider the following partitioning: ┌─┬┬─┐ │ │├─┤ ├─┤│ │ │ ├┤ │ └─┴┴─┘ How would you represent it in this API? That's two rows and three co

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-25 Thread James Almer
On 1/25/2024 2:17 PM, Anton Khirnov wrote: Quoting James Almer (2024-01-22 13:08:43) Or you could consider it a struct designed to represent a group of images combined in a grid, for the purpose of extracting a subrectangle for presentation. How many images there are is defined by the rows and c

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-25 Thread Anton Khirnov
Quoting James Almer (2024-01-22 13:08:43) > Or you could consider it a struct designed to represent a group of > images combined in a grid, for the purpose of extracting a subrectangle > for presentation. How many images there are is defined by the rows and > cols fields, and it can be 1. It st

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-25 Thread Anton Khirnov
Quoting James Almer (2024-01-22 12:59:52) > > > > I don't see how is that supposed to work. E.g. consider the following > > partitioning: > > ┌─┬┬─┐ > > │ │├─┤ > > ├─┤│ │ > > │ ├┤ │ > > └─┴┴─┘ > > > > How would you represent it in this API? > > That's two rows and three colum

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-22 Thread James Almer
On 1/22/2024 7:38 AM, Anton Khirnov wrote: Quoting James Almer (2024-01-21 22:03:10) I could remove the types and the union altogether and leave only the array even for uniform tiles if you think that simplifies the API, but seems like a waste of memory to allocate a rows x cols array of ints ju

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-22 Thread James Almer
On 1/22/2024 7:32 AM, Anton Khirnov wrote: Quoting James Almer (2024-01-21 20:29:58) On 1/21/2024 4:02 PM, Anton Khirnov wrote: I still don't see why should it be a good idea to use this struct for generic container cropping. It feels very much like a hammer in search of a nail. Because once

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-22 Thread James Almer
On 1/22/2024 7:32 AM, Anton Khirnov wrote: Quoting James Almer (2024-01-21 20:29:58) On 1/21/2024 4:02 PM, Anton Khirnov wrote: I still don't see why should it be a good idea to use this struct for generic container cropping. It feels very much like a hammer in search of a nail. Because once

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-22 Thread Anton Khirnov
Quoting James Almer (2024-01-21 22:03:10) > I could remove the types and the union altogether and leave only the > array even for uniform tiles if you think that simplifies the API, but > seems like a waste of memory to allocate a rows x cols array of ints > just to have the same value written for

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-22 Thread Anton Khirnov
Quoting James Almer (2024-01-21 20:29:58) > On 1/21/2024 4:02 PM, Anton Khirnov wrote: > > I still don't see why should it be a good idea to use this struct for > > generic container cropping. It feels very much like a hammer in search > > of a nail. > > Because once we support container cropping,

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-21 Thread James Almer
On 1/21/2024 4:29 PM, James Almer wrote: On 1/21/2024 4:02 PM, Anton Khirnov wrote: Quoting James Almer (2024-01-21 19:38:50) On 1/21/2024 3:29 PM, Anton Khirnov wrote: Quoting James Almer (2024-01-21 18:47:43) On 1/21/2024 2:29 PM, Anton Khirnov wrote: Honestly this whole new API strikes me

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-21 Thread James Almer
On 1/21/2024 4:02 PM, Anton Khirnov wrote: Quoting James Almer (2024-01-21 19:38:50) On 1/21/2024 3:29 PM, Anton Khirnov wrote: Quoting James Almer (2024-01-21 18:47:43) On 1/21/2024 2:29 PM, Anton Khirnov wrote: Honestly this whole new API strikes me as massively overthinking it. All you sho

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-21 Thread Anton Khirnov
Quoting James Almer (2024-01-21 19:38:50) > On 1/21/2024 3:29 PM, Anton Khirnov wrote: > > Quoting James Almer (2024-01-21 18:47:43) > >> On 1/21/2024 2:29 PM, Anton Khirnov wrote: > >>> Honestly this whole new API strikes me as massively overthinking it. All > >>> you should need to describe an ar

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-21 Thread James Almer
On 1/21/2024 3:29 PM, Anton Khirnov wrote: Quoting James Almer (2024-01-21 18:47:43) On 1/21/2024 2:29 PM, Anton Khirnov wrote: Honestly this whole new API strikes me as massively overthinking it. All you should need to describe an arbitrary partition of an image into sub-rectangles is an array

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-21 Thread Anton Khirnov
Quoting James Almer (2024-01-21 18:47:43) > On 1/21/2024 2:29 PM, Anton Khirnov wrote: > > Honestly this whole new API strikes me as massively overthinking it. All > > you should need to describe an arbitrary partition of an image into > > sub-rectangles is an array of (x, y, width, height). Instea

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-21 Thread James Almer
On 1/21/2024 2:29 PM, Anton Khirnov wrote: Quoting James Almer (2024-01-21 13:06:28) On 1/21/2024 3:27 AM, Anton Khirnov wrote: Quoting James Almer (2024-01-20 23:04:06) This includes a struct and helpers. It will be used to support container level cropping and tiled image formats, but should

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-21 Thread Anton Khirnov
Quoting James Almer (2024-01-21 13:06:28) > On 1/21/2024 3:27 AM, Anton Khirnov wrote: > > Quoting James Almer (2024-01-20 23:04:06) > >> This includes a struct and helpers. It will be used to support container > >> level > >> cropping and tiled image formats, but should be generic enough for gene

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-21 Thread James Almer
On 1/21/2024 3:27 AM, Anton Khirnov wrote: Quoting James Almer (2024-01-20 23:04:06) This includes a struct and helpers. It will be used to support container level cropping and tiled image formats, but should be generic enough for general usage. Signed-off-by: James Almer --- Extended to inclu

Re: [FFmpeg-devel] [PATCH 1/2 v2] avutil: add a Tile Grid API

2024-01-20 Thread Anton Khirnov
Quoting James Almer (2024-01-20 23:04:06) > This includes a struct and helpers. It will be used to support container level > cropping and tiled image formats, but should be generic enough for general > usage. > > Signed-off-by: James Almer > --- > Extended to include fields used for cropping. Sho