mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
avcodec/videotoolboxenc: support global_quality without qscale
(cherry picked from commit fc45127bcc79731a2e3ec5858a00c35c6cfbc1c0) Signed-off-by: Marvin Scholz <epirat07@gmail.com>
This commit is contained in:
parent
a2179be5e9
commit
d3265e15ee
1 changed files with 4 additions and 2 deletions
|
|
@ -1245,8 +1245,10 @@ static int vtenc_create_encoder(AVCodecContext *avctx,
|
|||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
if (avctx->flags & AV_CODEC_FLAG_QSCALE) {
|
||||
Float32 quality = fminf(avctx->global_quality / 100.0f / FF_QP2LAMBDA, 1.0f);
|
||||
if (avctx->flags & AV_CODEC_FLAG_QSCALE || avctx->global_quality > 0) {
|
||||
float factor = (avctx->flags & AV_CODEC_FLAG_QSCALE) ?
|
||||
FF_QP2LAMBDA * 100.0f : 100.0f;
|
||||
Float32 quality = fminf(avctx->global_quality / factor, 1.0f);
|
||||
CFNumberRef quality_num = CFNumberCreate(kCFAllocatorDefault,
|
||||
kCFNumberFloat32Type,
|
||||
&quality);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue