Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add support for ROI-based encoding

2019-01-17 Thread Derek Buitenhuis
On 16/01/2019 12:39, Derek Buitenhuis wrote:
> On 16/01/2019 00:41, Guo, Yejun wrote:
>> this patch set asks for pushing if no more concerns, thanks.
> 
> I support this.
> 
> If nobody raises any concerns in the next 24-48 hrs, I'll go ahead.
> 
> Thank you for sticking with it through the bikeshedding.

Pushed.

- Derek

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add support for ROI-based encoding

2019-01-16 Thread Derek Buitenhuis
On 16/01/2019 00:41, Guo, Yejun wrote:
> this patch set asks for pushing if no more concerns, thanks.

I support this.

If nobody raises any concerns in the next 24-48 hrs, I'll go ahead.

Thank you for sticking with it through the bikeshedding.

- Derek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add support for ROI-based encoding

2019-01-15 Thread Guo, Yejun
this patch set asks for pushing if no more concerns, thanks.

> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Guo, Yejun
> Sent: Friday, January 11, 2019 9:39 AM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add support
> for ROI-based encoding
> 
> 
> 
> > -Original Message-
> > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On
> Behalf
> > Of Carl Eugen Hoyos
> > Sent: Friday, January 11, 2019 8:54 AM
> > To: FFmpeg development discussions and patches  > de...@ffmpeg.org>
> > Subject: Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add
> > support for ROI-based encoding
> >
> > 2019-01-11 1:37 GMT+01:00, Guo, Yejun :
> >
> > >> 2019-01-10 9:54 GMT+01:00, Guo, Yejun :
> > >>
> > >> > +roi = (AVRegionOfInterest*)((char*)roi +
> > >> > roi->self_size);
> > >>
> > >> Isn't this roi++?
> > >> If yes, please change this.
> > >
> > > no, it's not roi++, the reason is that struct AVRegionOfInterest
> > > might be extended, so to keep ABI compatible, we add the
> > > 'self_size'.  It is discussed in V4 comments.
> >
> > So after AVRegionOfInterest was extended, you as a user who had
> > compiled his application against old libavcodec will use new
> > libavcodec (with the
> > extension) and it will be guaranteed that libx264 will still get the
> > correct information although only the part of the struct before the
> > extension was filled?
> > Does this guarantee really help?
> 
> yes, I think it helps. otherwise, it becomes a possible ABI issue.
> 
> >
> > >> I also wonder if the wording (elsewhere) of "returns EINVAL if size
> > >> is zero" is correct: Shouldn't it be "size must be >0"
> > >
> > > self_size is uint32_t, it is > 0 if not zero.
> >
> > The comment I saw is in another file (probably another patch), sorry
> > if this is confusing (I also find it confusing).
> > I will hopefully not be affected by the documentation, I just wanted
> > to point out that the wording is misleading imo, because structs do not
> return errors.
> 
> I see, it is in frame.h of patch 1/2.
> 
> imho, current wording is not misleading, the wording exactly matches the
> code, while the code is acceptable.
> There is also an explicit note (very close these wording) that the correct 
> value
> should be sizeof(AVRegionOfInterest).
> 
> Regarding "structs do not return errors":
> 
> > or similar? A struct can hardly return an error, no?
> it is caller's responsibility to set the value to be 
> sizeof(AVRegionOfInterest).
> There will be an error returned if the caller does not set it explicitly.
> 
> >
> > Carl Eugen
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add support for ROI-based encoding

2019-01-10 Thread Guo, Yejun


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Carl Eugen Hoyos
> Sent: Friday, January 11, 2019 8:54 AM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add support
> for ROI-based encoding
> 
> 2019-01-11 1:37 GMT+01:00, Guo, Yejun :
> 
> >> 2019-01-10 9:54 GMT+01:00, Guo, Yejun :
> >>
> >> > +roi = (AVRegionOfInterest*)((char*)roi +
> >> > roi->self_size);
> >>
> >> Isn't this roi++?
> >> If yes, please change this.
> >
> > no, it's not roi++, the reason is that struct AVRegionOfInterest might
> > be extended, so to keep ABI compatible, we add the 'self_size'.  It is
> > discussed in V4 comments.
> 
> So after AVRegionOfInterest was extended, you as a user who had compiled
> his application against old libavcodec will use new libavcodec (with the
> extension) and it will be guaranteed that libx264 will still get the correct
> information although only the part of the struct before the extension was
> filled?
> Does this guarantee really help?

yes, I think it helps. otherwise, it becomes a possible ABI issue.

> 
> >> I also wonder if the wording (elsewhere) of "returns EINVAL if size
> >> is zero" is correct: Shouldn't it be "size must be >0"
> >
> > self_size is uint32_t, it is > 0 if not zero.
> 
> The comment I saw is in another file (probably another patch), sorry if this 
> is
> confusing (I also find it confusing).
> I will hopefully not be affected by the documentation, I just wanted to point
> out that the wording is misleading imo, because structs do not return errors.

I see, it is in frame.h of patch 1/2.

imho, current wording is not misleading, the wording exactly matches the code, 
while the code is acceptable.
There is also an explicit note (very close these wording) that the correct 
value should be sizeof(AVRegionOfInterest).

Regarding "structs do not return errors": 

> or similar? A struct can hardly return an error, no?
it is caller's responsibility to set the value to be sizeof(AVRegionOfInterest).
There will be an error returned if the caller does not set it explicitly.

> 
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add support for ROI-based encoding

2019-01-10 Thread Carl Eugen Hoyos
2019-01-11 1:37 GMT+01:00, Guo, Yejun :

>> 2019-01-10 9:54 GMT+01:00, Guo, Yejun :
>>
>> > +roi = (AVRegionOfInterest*)((char*)roi +
>> > roi->self_size);
>>
>> Isn't this roi++?
>> If yes, please change this.
>
> no, it's not roi++, the reason is that struct AVRegionOfInterest might be
> extended,
> so to keep ABI compatible, we add the 'self_size'.  It is discussed in V4
> comments.

So after AVRegionOfInterest was extended, you as a user who had
compiled his application against old libavcodec will use new libavcodec
(with the extension) and it will be guaranteed that libx264 will still get
the correct information although only the part of the struct before the
extension was filled?
Does this guarantee really help?

>> I also wonder if the wording (elsewhere) of "returns EINVAL if
>> size is zero" is correct: Shouldn't it be "size must be >0"
>
> self_size is uint32_t, it is > 0 if not zero.

The comment I saw is in another file (probably another patch),
sorry if this is confusing (I also find it confusing).
I will hopefully not be affected by the documentation, I just wanted
to point out that the wording is misleading imo, because structs
do not return errors.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add support for ROI-based encoding

2019-01-10 Thread Guo, Yejun


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Carl Eugen Hoyos
> Sent: Friday, January 11, 2019 1:19 AM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add support
> for ROI-based encoding
> 
> 2019-01-10 9:54 GMT+01:00, Guo, Yejun :
> 
> > +roi = (AVRegionOfInterest*)((char*)roi +
> > roi->self_size);
> 
> Isn't this roi++?
> If yes, please change this.

no, it's not roi++, the reason is that struct AVRegionOfInterest might be 
extended,
so to keep ABI compatible, we add the 'self_size'.  It is discussed in V4 
comments.

> 
> I also wonder if the wording (elsewhere) of "returns EINVAL if size is zero" 
> is
> correct: Shouldn't it be "size must be >0"

self_size is uint32_t, it is > 0 if not zero.  


> or similar? A struct can hardly return an error, no?

it is caller's responsibility to set the value to be sizeof(AVRegionOfInterest).
There will be an error if the caller does not set it explicitly.

> 
> Sorry for the late comment, Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V8 2/2] avcodec/libx264: add support for ROI-based encoding

2019-01-10 Thread Carl Eugen Hoyos
2019-01-10 9:54 GMT+01:00, Guo, Yejun :

> +roi = (AVRegionOfInterest*)((char*)roi +
> roi->self_size);

Isn't this roi++?
If yes, please change this.

I also wonder if the wording (elsewhere) of "returns EINVAL
if size is zero" is correct: Shouldn't it be "size must be >0"
or similar? A struct can hardly return an error, no?

Sorry for the late comment, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel