Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-19 Thread Nicolas George
Juan De León (12019-08-19): > > > +size_t size = sizeof(AVEncodeInfoFrame) + > > sizeof(AVEncodeInfoBlock)*FFMAX((int)(nb_blocks - 1), 0); > > > > (Commenting from my phone because urgent.) > > This line do not make sense to me. Can you explain the reason for the > > cast and how you avoid

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-19 Thread Juan De León
On Sat, Aug 17, 2019 at 7:00 AM Nicolas George wrote: > > +#define AV_ENCODE_INFO_MAX_BLOCKS 33177600 > > + > > +static int init_encode_info_data(AVEncodeInfoFrame *info, unsigned int > nb_blocks) { > > +info->nb_blocks = nb_blocks; > > +info->block_size = sizeof(AVEncodeInfoBlock); > >

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-17 Thread Nicolas George
Juan De León (12019-08-16): > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > AV_FRAME_DATA_ENCODE_INFO. > The structure stores quantization index for each plane, DC/AC deltas > for luma and chroma planes, and an array of AVEncodeInfoBlock type > denoting position, size, and

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures (fwd)

2019-08-16 Thread Nicolas George
- Forwarded message from Nicolas George - Date: Fri, 16 Aug 2019 13:55:18 +0200 From: Nicolas George To: Juan De León Subject: Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures Juan De León (12019-08-15): > I don't think it's common for size_t to wrap around. siz

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-15 Thread Nicolas George
Juan De León (12019-08-15): > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > AV_FRAME_DATA_ENCODE_INFO. > The structure stores quantization index for each plane, DC/AC deltas > for luma and chroma planes, and an array of AVEncodeInfoBlock type > denoting position, size, and

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-15 Thread James Almer
On 8/15/2019 3:47 PM, Nicolas George wrote: > Alex Sukhanov (12019-08-15): >> Time is important here. Juan's internship is ending soon. Juan has been >> working with Lynne on this design. Since there is back and forth emails in >> this thread, it would be very helpful for Juan if Nicolas and Lynne

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-15 Thread Lynne
Aug 15, 2019, 19:47 by geo...@nsup.org: > Alex Sukhanov (12019-08-15): > >> Time is important here. Juan's internship is ending soon. Juan has been >> working with Lynne on this design. Since there is back and forth emails in >> this thread, it would be very helpful for Juan if Nicolas and Lynne

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-15 Thread Nicolas George
Alex Sukhanov (12019-08-15): > Time is important here. Juan's internship is ending soon. Juan has been > working with Lynne on this design. Since there is back and forth emails in > this thread, it would be very helpful for Juan if Nicolas and Lynne get to > some agreement, rather than have intern

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-15 Thread Alex Sukhanov
On Thu, Aug 15, 2019 at 11:07 AM Nicolas George wrote: > Juan De León (12019-08-15): > > Ping. Does anyone have any more feedback? > > If not, can anyone review this for pushing. > > Less than 24 hours feel a bit short to get impatient. > > Regards, > > -- > Nicolas George >

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-15 Thread Nicolas George
Juan De León (12019-08-14): > In that case, I believe documenting the size of the array and behaviour of > undefined indexes should be enough. Have the pointers return NULL, > and let the user handle the result, instead of stopping the execution. I disagree. Either drop the check altogether or

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-15 Thread Nicolas George
Juan De León (12019-08-15): > Ping. Does anyone have any more feedback? > If not, can anyone review this for pushing. Less than 24 hours feel a bit short to get impatient. Regards, -- Nicolas George ___ ffmpeg-devel mailing list

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-15 Thread Paul B Mahol
On Thu, Aug 15, 2019 at 7:43 PM Juan De León < juandl-at-google@ffmpeg.org> wrote: > On Wed, Aug 14, 2019 at 12:11 PM Juan De León wrote: > > > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > > AV_FRAME_DATA_ENCODE_INFO. > > The structure stores quantization index for

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-15 Thread Juan De León
On Wed, Aug 14, 2019 at 12:11 PM Juan De León wrote: > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > AV_FRAME_DATA_ENCODE_INFO. > The structure stores quantization index for each plane, DC/AC deltas > for luma and chroma planes, and an array of AVEncodeInfoBlock type >

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-14 Thread Juan De León
On Wed, Aug 14, 2019 at 12:10 AM Nicolas George wrote: > James Almer (12019-08-13): > > I'm fairly sure this was discussed before, but invalid arguments > > shouldn't crash an user's application. They even have their own > > standardized errno value for this purpose. > > asserts() are to catch

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-14 Thread Nicolas George
James Almer (12019-08-13): > I'm fairly sure this was discussed before, but invalid arguments > shouldn't crash an user's application. They even have their own > standardized errno value for this purpose. > asserts() are to catch bugs in our code, not in theirs. Returning a NULL > pointer is the

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-13 Thread Juan De León
On Tue, Aug 13, 2019 at 4:49 PM James Almer wrote: > I'm fairly sure this was discussed before, but invalid arguments > shouldn't crash an user's application. They even have their own > standardized errno value for this purpose. > asserts() are to catch bugs in our code, not in theirs. Returning

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-13 Thread James Almer
On 8/13/2019 7:29 PM, Nicolas George wrote: > Juan De León (12019-08-13): >> The array is there so that the structure isn't opaque, it should be >> accessed with the function. > > I realize you need it, but not for the reason you say. It is needed for > alignment: if blocks needs more alignment

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-13 Thread Nicolas George
Juan De León (12019-08-13): > The array is there so that the structure isn't opaque, it should be > accessed with the function. I realize you need it, but not for the reason you say. It is needed for alignment: if blocks needs more alignment than info, info+sizeof(info) is not a valid pointer for

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-13 Thread Juan De León
On Tue, Aug 13, 2019 at 2:49 PM Nicolas George wrote: > > +info->blocks_offset = offsetof(AVEncodeInfoFrame, blocks); > > You can use sizeof(AVEncodeInfoFrame) and dispense with the blocks final > array entirely. > The array is there so that the structure isn't opaque, it should be accessed

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-13 Thread Nicolas George
Juan De León (12019-08-13): > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > AV_FRAME_DATA_ENCODE_INFO. > The structure stores quantization index for each plane, DC/AC deltas > for luma and chroma planes, and an array of AVEncodeInfoBlock type > denoting position, size, and

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-12 Thread Michael Niedermayer
On Mon, Aug 12, 2019 at 11:25:59AM -0700, Juan De León wrote: > Pinging, > Any other opinions? About adding a reserved[128] ? i think storing the size somewhere is probably better (less memory, and not having an arbitrary limit which could theoretically be hit one day) thx [...] -- Michael

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-12 Thread Juan De León
Pinging, Any other opinions? On Sat, Aug 10, 2019 at 2:22 AM Nicolas George wrote: > Lynne (12019-08-10): > > >> +typedef struct AVEncodeInfoBlock{ > > >> +/** > > >> + * Distance in luma pixels from the top-left corner of the > visible frame > > >> + * to the top-left corner of the

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-10 Thread Nicolas George
Lynne (12019-08-10): > >> +typedef struct AVEncodeInfoBlock{ > >> +/** > >> + * Distance in luma pixels from the top-left corner of the visible > >> frame > >> + * to the top-left corner of the block. > >> + * Can be negative if top/right padding is present on the coded frame. >

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-09 Thread Lynne
Aug 9, 2019, 22:54 by geo...@nsup.org: > Juan De León (12019-08-09): > >> AVEncodeInfoFrame data structure to store as AVFrameSideData of type >> AV_FRAME_DATA_ENCODE_INFO. >> The structure stores quantization index for each plane, DC/AC deltas >> for luma and chroma planes, and an array of

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures

2019-08-09 Thread Nicolas George
Juan De León (12019-08-09): > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > AV_FRAME_DATA_ENCODE_INFO. > The structure stores quantization index for each plane, DC/AC deltas > for luma and chroma planes, and an array of AVEncodeInfoBlock type > denoting position, size, and

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures and AV_FRAME_DATA_ENCODE_INFO AVFrameSideDataType

2019-08-09 Thread James Almer
On 8/9/2019 3:28 PM, Nicolas George wrote: > James Almer (12019-08-09): >> Or just a pointer that points to the first byte after itself. > > The pointer takes places by itself. And it prevents the structure from > being copied flatly, which IIRC is forbidden with side data. Yeah, you're right,

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures and AV_FRAME_DATA_ENCODE_INFO AVFrameSideDataType

2019-08-09 Thread Nicolas George
James Almer (12019-08-09): > Or just a pointer that points to the first byte after itself. The pointer takes places by itself. And it prevents the structure from being copied flatly, which IIRC is forbidden with side data. By the way, the lines of the commit message are too long. Regards, --

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures and AV_FRAME_DATA_ENCODE_INFO AVFrameSideDataType

2019-08-09 Thread James Almer
On 8/9/2019 2:58 PM, Hendrik Leppkes wrote: > On Fri, Aug 9, 2019 at 7:52 PM James Almer wrote: >> >> On 8/9/2019 2:38 PM, Juan De León wrote: >>> AVEncodeInfoFrame data structure to store as AVFrameSideData of type >>> AV_FRAME_DATA_ENCODE_INFO. >>> The structure stores quantization index for

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures and AV_FRAME_DATA_ENCODE_INFO AVFrameSideDataType

2019-08-09 Thread Hendrik Leppkes
On Fri, Aug 9, 2019 at 7:52 PM James Almer wrote: > > On 8/9/2019 2:38 PM, Juan De León wrote: > > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > > AV_FRAME_DATA_ENCODE_INFO. > > The structure stores quantization index for each plane, DC/AC deltas for > > luma and chroma

Re: [FFmpeg-devel] [PATCH] libavutil: AVEncodeInfo data structures and AV_FRAME_DATA_ENCODE_INFO AVFrameSideDataType

2019-08-09 Thread James Almer
On 8/9/2019 2:38 PM, Juan De León wrote: > AVEncodeInfoFrame data structure to store as AVFrameSideData of type > AV_FRAME_DATA_ENCODE_INFO. > The structure stores quantization index for each plane, DC/AC deltas for luma > and chroma planes, and an array of AVEncodeInfoBlock struct denoting >