(cherry picked from commit fc45127bcc79731a2e3ec5858a00c35c6cfbc1c0) Signed-off-by: Marvin Scholz <epirat07@gmail.com>
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -1245,8 +1245,10 @@ static int vtenc_create_encoder(AVCodecContext *avctx, · 1244 unmodified lines | |||
| 1245 | return AVERROR_EXTERNAL; | 1245 | return AVERROR_EXTERNAL; |
| 1246 | } | 1246 | } |
| 1247 | 1247 | ||
| 1248 | if (avctx->flags & AV_CODEC_FLAG_QSCALE) { | 1248 | if (avctx->flags & AV_CODEC_FLAG_QSCALE || avctx->global_quality > 0) { |
| 1249 | Float32 quality = fminf(avctx->global_quality / 100.0f / FF_QP2LAMBDA, 1.0f); | 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); | ||
| 1250 | CFNumberRef quality_num = CFNumberCreate(kCFAllocatorDefault, | 1252 | CFNumberRef quality_num = CFNumberCreate(kCFAllocatorDefault, |
| 1251 | kCFNumberFloat32Type, | 1253 | kCFNumberFloat32Type, |
| 1252 | &quality); | 1254 | &quality); |