History

avcodec/videotoolboxenc: support global_quality without qscale

(cherry picked from commit fc45127bcc79731a2e3ec5858a00c35c6cfbc1c0) Signed-off-by: Marvin Scholz <epirat07@gmail.com>

Zhao Zhili committed 1 year ago

Commit d3265e11 parent a2179be1 file · +4 −2Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/videotoolboxenc.c+4−2
@@ -1245,8 +1245,10 @@ static int vtenc_create_encoder(AVCodecContext *avctx, · 1244 unmodified lines
12451245 return AVERROR_EXTERNAL;
12461246 }
12471247
1248− if (avctx->flags & AV_CODEC_FLAG_QSCALE) {
1249− Float32 quality = fminf(avctx->global_quality / 100.0f / FF_QP2LAMBDA, 1.0f);
1248+ if (avctx->flags & AV_CODEC_FLAG_QSCALE || avctx->global_quality > 0) {
1249+ float factor = (avctx->flags & AV_CODEC_FLAG_QSCALE) ?
1250+ FF_QP2LAMBDA * 100.0f : 100.0f;
1251+ Float32 quality = fminf(avctx->global_quality / factor, 1.0f);
12501252 CFNumberRef quality_num = CFNumberCreate(kCFAllocatorDefault,
12511253 kCFNumberFloat32Type,
12521254 &quality);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t