MCPcopy Create free account
hub / github.com/AOMediaCodec/libavif / avmQualityToQuantizer

Function avmQualityToQuantizer

src/codec_avm.c:421–431  ·  view source on GitHub ↗

Converts quality to avm's quantizer in the range of [M:255], where M=0/-48/-96 for 8/10/12 bit. See --min-qp help in https://gitlab.com/AOMediaCodec/avm/-/blob/main/apps/avmenc.c

Source from the content-addressed store, hash-verified

419// See --min-qp help in
420// https://gitlab.com/AOMediaCodec/avm/-/blob/main/apps/avmenc.c
421static int avmQualityToQuantizer(int quality, uint32_t depth)
422{
423 if (depth == 10) {
424 return 255 - (quality * (255 + 48) + 50) / 100;
425 }
426 if (depth == 12) {
427 return 255 - (quality * (255 + 96) + 50) / 100;
428 }
429 assert(depth == 8);
430 return 255 - (quality * 255 + 50) / 100;
431}
432
433static avifBool avmCodecEncodeFinish(avifCodec * codec, avifCodecEncodeOutput * output);
434

Callers 1

avmCodecEncodeImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected