Message ID | 20200518135636.1424-1-jamrial@gmail.com |
---|---|
State | Accepted |
Commit | 6275a7ec735b2cccaf1ab430d3c777f0ade4b18f |
Headers | show |
Series | [FFmpeg-devel] avcodec/frame_thread_encoder: check for frame threading codec cap instead of intra only | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
Quoting James Almer (2020-05-18 15:56:36) > It's the correct dedicated capability reported by supported encoders. > Otherwise, the frame thread path will be used for unsupported encoders > like r210 for no gain. > > Signed-off-by: James Almer <jamrial@gmail.com> > --- Looks ok. Also, this capability looks like it should not exist since it's not an encoder capability, it's a codec property. Same for CAP_LOSSLESS.
On 5/18/2020 11:36 AM, Anton Khirnov wrote: > Quoting James Almer (2020-05-18 15:56:36) >> It's the correct dedicated capability reported by supported encoders. >> Otherwise, the frame thread path will be used for unsupported encoders >> like r210 for no gain. >> >> Signed-off-by: James Almer <jamrial@gmail.com> >> --- > > Looks ok. > > Also, this capability looks like it should not exist since it's not an > encoder capability, it's a codec property. Same for CAP_LOSSLESS. True. There's a AVCodecDescriptor.props flag for both of them after all. Also, after this change AV_CODEC_CAP_INTRA_ONLY is unused (not counting cmdutils.c where it's used to print an entry in a log message), so we could safely deprecate it and remove it.
diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c index 949bc69f81..bb4b5d7341 100644 --- a/libavcodec/frame_thread_encoder.c +++ b/libavcodec/frame_thread_encoder.c @@ -120,7 +120,7 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){ if( !(avctx->thread_type & FF_THREAD_FRAME) - || !(avctx->codec->capabilities & AV_CODEC_CAP_INTRA_ONLY)) + || !(avctx->codec->capabilities & AV_CODEC_CAP_FRAME_THREADS)) return 0; if( !avctx->thread_count
It's the correct dedicated capability reported by supported encoders. Otherwise, the frame thread path will be used for unsupported encoders like r210 for no gain. Signed-off-by: James Almer <jamrial@gmail.com> --- libavcodec/frame_thread_encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)