[FFmpeg-devel] [PATCH 212/217] avcodec/snow: Fix race in ff_snow_common_init()

2020-12-01 Thread Andreas Rheinhardt
Commits d49210788b0836d56dd872d517fe73f83b080101 and ee8ce211ead04c8684da0c9c143814e57e9b9eda set the FF_CODEC_CAP_INIT_THREADSAFE flag for the Snow encoder resp. decoder; yet these codecs init functions aren't threadsafe at all: ff_snow_common_init() initializes static data, but there is no check

[FFmpeg-devel] [PATCH 213/217] avcodec/me_cmp: Remove ff_check_alignment()

2020-12-01 Thread Andreas Rheinhardt
The usage of a static variable presents a potential for data races and means that this function can't be used in init functions of codecs with FF_CODEC_CAP_INIT_THREADSAFE (unless of course one presumes that everything is alright in which case the error is not triggered; but then the whole function

[FFmpeg-devel] [PATCH 214/217] avcodec/ituh263enc: Remove unused function parameter

2020-12-01 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/ituh263enc.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c index b1b78218a5..e1debcf63b 100644 --- a/libavcodec/ituh263enc.c +++ b/libavcodec/ituh263enc.c @@

[FFmpeg-devel] [PATCH 215/217] avcodec/ituh263enc: Use ff_thread_once() for static initializations

2020-12-01 Thread Andreas Rheinhardt
This already makes initializing all the objects exclusively initialized by ff_h263_encode_init() thread-safe; this includes the static tables of ituh263enc.c: uni_h263_int*_rl_len, mv_penalty, fcode_tab as well as umv_fcode_tab; it does not ff_h263_rl_inter as well as ff_rl_intra_aic, as these are

[FFmpeg-devel] [PATCH 216/217] avcodec/h263data, ituh263*: Make initializing RL tables thread-safe

2020-12-01 Thread Andreas Rheinhardt
Up until now, ff_h263_rl_inter and ff_rl_intra_aic were initialized by both ituh263dec and ituh263enc; the result was that although ff_h263_encode_init() guards the initialization of its static data with an AVOnce, initializing the aforementioned RLTables was still not thread-safe because ff_h263_d

[FFmpeg-devel] [PATCH 217/217] avcodec/snow: Hardcode table to save space

2020-12-01 Thread Andreas Rheinhardt
The size of ff_qexp is only 32 bytes, but the code to generate it at runtime takes 47 bytes (GCC 9.3, x64, -O3 in an av_cold function); so just hardcode it. Signed-off-by: Andreas Rheinhardt --- libavcodec/snow.c | 10 -- libavcodec/snow.h | 2 +- libavcodec/snowdata.h | 10

[FFmpeg-devel] [PATCH 135/217] avcodec/dfa: Mark decoder as init-threadsafe

2020-12-01 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/dfa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 31c6c39089..cd3a9d97a3 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -424,4 +424,5 @@ AVCodec ff_dfa_decoder = { .close = df

[FFmpeg-devel] [PATCH 136/217] avcodec/cscd: Mark decoder as init-threadsafe

2020-12-01 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/cscd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index d50ddd6258..6c72178f83 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -175,6 +175,6 @@ AVCodec ff_cscd_decoder = {

Re: [FFmpeg-devel] [PATCH 1/5] avcodec/qsvdec_other: refact, use DEFINE_QSV_DECODER to remove duplicate code

2020-12-01 Thread Xiang, Haihao
> --- > libavcodec/qsvdec_other.c | 188 -- > 1 file changed, 36 insertions(+), 152 deletions(-) > > diff --git a/libavcodec/qsvdec_other.c b/libavcodec/qsvdec_other.c > index 2775e07955..266ac9f2e5 100644 > --- a/libavcodec/qsvdec_other.c > +++ b/libavcodec/q

Re: [FFmpeg-devel] [PATCH 3/5] avcodec/qsvdec: refact, move qsvdec_h2645.c to qsvdec.c

2020-12-01 Thread Xiang, Haihao
On Thu, 2020-11-26 at 18:20 +0800, Xu Guangxin wrote: > --- > libavcodec/Makefile | 8 +- > libavcodec/qsvdec.c | 215 - > libavcodec/qsvdec_h2645.c | 248 -- > 3 files changed, 217 insertions(+), 254 deletions(-) >

Re: [FFmpeg-devel] [PATCH 1/5] avcodec/qsvdec_other: refact, use DEFINE_QSV_DECODER to remove duplicate code

2020-12-01 Thread Guangxin Xu
Hi Haihao, If you check the final code. The QSVOtherContext and QSVH2645Context will be unified to QSVDecContext. It's no need to pass the priv_data_size. In the final version, we have two macros DEFINE_QSV_DECODER_WITH_OPTION for h265 only. Maybe av1 can use it for film grain too. DEFINE_QSV_DECO

Re: [FFmpeg-devel] [PATCH 1/5] avcodec/qsvdec_other: refact, use DEFINE_QSV_DECODER to remove duplicate code

2020-12-01 Thread Xiang, Haihao
> Hi Haihao, > If you check the final code. The QSVOtherContext and QSVH2645Context will > be unified to QSVDecContext. It's no need to pass the priv_data_size. > > In the final version, we have two macros > DEFINE_QSV_DECODER_WITH_OPTION for h265 only. Maybe av1 can use it for film > grain too.

Re: [FFmpeg-devel] [PATCH 3/5] avcodec/qsvdec: refact, move qsvdec_h2645.c to qsvdec.c

2020-12-01 Thread Guangxin Xu
Hi Haihao, Thanks for the review. This patch just moves all code from qsvdec_h2645.c to qsvdec.c. The original code in qsvdec_h2645.c did not free the point, so the code will not free it. The av_freep(&s->qsv.load_plugins); will addressed by https://patchwork.ffmpeg.org/project/ffmpeg/patch/2020112

Re: [FFmpeg-devel] [PATCH] libavcodec/qsvenc: add max_frame_size support for hevc_qsv

2020-12-01 Thread Xiang, Haihao
On Wed, 2020-12-02 at 09:52 +0800, wenbin.c...@intel.com wrote: > From: Wenbinc-Bin > > The max_frame_size parameter is set only when codec is h264. Now I add > hevc in that conditional statement. > > Signed-off-by: Wenbin CHEN > --- > libavcodec/qsvenc.c | 2 +- > 1 file changed, 1 insertion(

<    1   2