Re: [FFmpeg-devel] [PATCH] h264_slice: Copy the value of x264_build before calling h264_slice_header_init during thread init

2018-10-09 Thread Tristan Matthews
On Tue, Oct 9, 2018 at 10:15 AM Derek Buitenhuis
 wrote:
>
> On 08/10/2018 16:36, Derek Buitenhuis wrote:
> > If we don't copy this value first, it is seen as 0 by 
> > h264_slice_header_init,
> > due to zero-allocation of the new context, triggering an old hack that
> > multiplied the denominator by 2 for files produced by old x264 versions, but
> > only if more than one thread was used.
> >
> > Fixes #7475.
> >
> > Signed-off-by: Derek Buitenhuis
> > ---
> >   libavcodec/h264_slice.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
>
> Pushed, thanks.
>
> - Derek
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

BTW, looks like this bug isn't present in 4.0.2.

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


Re: [FFmpeg-devel] [PATCH] h264_slice: Copy the value of x264_build before calling h264_slice_header_init during thread init

2018-10-09 Thread Derek Buitenhuis
On 08/10/2018 16:36, Derek Buitenhuis wrote:
> If we don't copy this value first, it is seen as 0 by h264_slice_header_init,
> due to zero-allocation of the new context, triggering an old hack that
> multiplied the denominator by 2 for files produced by old x264 versions, but
> only if more than one thread was used.
> 
> Fixes #7475.
> 
> Signed-off-by: Derek Buitenhuis
> ---
>   libavcodec/h264_slice.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH] h264_slice: Copy the value of x264_build before calling h264_slice_header_init during thread init

2018-10-08 Thread Derek Buitenhuis
On 08/10/2018 19:52, Carl Eugen Hoyos wrote:
> Please also mention ticket #7083 in the commit message.
> 
> Sorry for my other mail, thank you for testing again!

Added locally, thanks.

Wasn't aware of that bug; could have saved me 30 mins of printf debugging.

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


Re: [FFmpeg-devel] [PATCH] h264_slice: Copy the value of x264_build before calling h264_slice_header_init during thread init

2018-10-08 Thread Carl Eugen Hoyos
2018-10-08 17:36 GMT+02:00, Derek Buitenhuis :
> If we don't copy this value first, it is seen as 0 by
> h264_slice_header_init,
> due to zero-allocation of the new context, triggering an old hack that
> multiplied the denominator by 2 for files produced by old x264 versions, but
> only if more than one thread was used.
>
> Fixes #7475.

Please also mention ticket #7083 in the commit message.

Sorry for my other mail, thank you for testing again!

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


Re: [FFmpeg-devel] [PATCH] h264_slice: Copy the value of x264_build before calling h264_slice_header_init during thread init

2018-10-08 Thread James Almer
On 10/8/2018 3:45 PM, Derek Buitenhuis wrote:
> On 08/10/2018 19:23, Carl Eugen Hoyos wrote:
>> I cannot reproduce ticket #7475 (it says "framerate num 30 den 1"
>> no matter how many threads I use, tested with up to 8), and - more
>> related to this patch - the sample from ticket #7475 reaches neither
>> line 358 nor line 400 in h264_slice.c here when running the command
>> shown in the ticket.
>>
>> $ md5sum crew_cif_timecode-2.h264
>> 43fbbb4ead1af31ed19dbb6582761d73  crew_cif_timecode-2.h264
>>
>> Do you know what I am doing wrong?
> 
> Your MD5 matches mine. 
> 
> Running on Linux (vanilla Debian unstable), using the patch from the trac 
> entry:
> $ ffmpeg -threads 1 -i crew_cif_timecode-2.h264 -f null -
> 
> I get this: https://pastebin.com/9TLB0ewm
> 
> And with:
> $ ffmpeg -threads 2 -i crew_cif_timecode-2.h264 -f null -
> 
> I get this: https://pastebin.com/upaJUXUA
> 
> Any value above 1 should be enough to reproduce.
> 
> It's possible it may only present itself on Linux (if you are on Windows).

No, i can reproduce it on Windows with a mingw-w64 build. Same output as
the one you pasted, and your patch fixes it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] h264_slice: Copy the value of x264_build before calling h264_slice_header_init during thread init

2018-10-08 Thread Derek Buitenhuis
On 08/10/2018 19:23, Carl Eugen Hoyos wrote:
> I cannot reproduce ticket #7475 (it says "framerate num 30 den 1"
> no matter how many threads I use, tested with up to 8), and - more
> related to this patch - the sample from ticket #7475 reaches neither
> line 358 nor line 400 in h264_slice.c here when running the command
> shown in the ticket.
> 
> $ md5sum crew_cif_timecode-2.h264
> 43fbbb4ead1af31ed19dbb6582761d73  crew_cif_timecode-2.h264
> 
> Do you know what I am doing wrong?

Your MD5 matches mine. 

Running on Linux (vanilla Debian unstable), using the patch from the trac entry:
$ ffmpeg -threads 1 -i crew_cif_timecode-2.h264 -f null -

I get this: https://pastebin.com/9TLB0ewm

And with:
$ ffmpeg -threads 2 -i crew_cif_timecode-2.h264 -f null -

I get this: https://pastebin.com/upaJUXUA

Any value above 1 should be enough to reproduce.

It's possible it may only present itself on Linux (if you are on Windows).

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


Re: [FFmpeg-devel] [PATCH] h264_slice: Copy the value of x264_build before calling h264_slice_header_init during thread init

2018-10-08 Thread Carl Eugen Hoyos
2018-10-08 17:36 GMT+02:00, Derek Buitenhuis :
> If we don't copy this value first, it is seen as 0 by
> h264_slice_header_init,
> due to zero-allocation of the new context, triggering an old hack that
> multiplied the denominator by 2 for files produced by old x264 versions, but
> only if more than one thread was used.
>
> Fixes #7475.
>
> Signed-off-by: Derek Buitenhuis 
> ---
>  libavcodec/h264_slice.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index 58e1aaf02f..d09cee4b13 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -358,6 +358,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
>  h->mb_num= h1->mb_num;
>  h->mb_stride = h1->mb_stride;
>  h->b_stride  = h1->b_stride;
> +h->x264_build = h1->x264_build;
>
>  if (h->context_initialized || h1->context_initialized) {
>  if ((err = h264_slice_header_init(h)) < 0) {
> @@ -399,7 +400,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
>
>  h->enable_er   = h1->enable_er;
>  h->workaround_bugs = h1->workaround_bugs;
> -h->x264_build  = h1->x264_build;

I cannot reproduce ticket #7475 (it says "framerate num 30 den 1"
no matter how many threads I use, tested with up to 8), and - more
related to this patch - the sample from ticket #7475 reaches neither
line 358 nor line 400 in h264_slice.c here when running the command
shown in the ticket.

$ md5sum crew_cif_timecode-2.h264
43fbbb4ead1af31ed19dbb6582761d73  crew_cif_timecode-2.h264

Do you know what I am doing wrong?

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


[FFmpeg-devel] [PATCH] h264_slice: Copy the value of x264_build before calling h264_slice_header_init during thread init

2018-10-08 Thread Derek Buitenhuis
If we don't copy this value first, it is seen as 0 by h264_slice_header_init,
due to zero-allocation of the new context, triggering an old hack that
multiplied the denominator by 2 for files produced by old x264 versions, but
only if more than one thread was used.

Fixes #7475.

Signed-off-by: Derek Buitenhuis 
---
 libavcodec/h264_slice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 58e1aaf02f..d09cee4b13 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -358,6 +358,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
 h->mb_num= h1->mb_num;
 h->mb_stride = h1->mb_stride;
 h->b_stride  = h1->b_stride;
+h->x264_build = h1->x264_build;
 
 if (h->context_initialized || h1->context_initialized) {
 if ((err = h264_slice_header_init(h)) < 0) {
@@ -399,7 +400,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
 
 h->enable_er   = h1->enable_er;
 h->workaround_bugs = h1->workaround_bugs;
-h->x264_build  = h1->x264_build;
 h->droppable   = h1->droppable;
 
 // extradata/NAL handling
-- 
2.19.0

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