X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdcaenc.h;h=63fdaf074eb93763349ee145a28d46112e5333c3;hb=c996374d4d86e0efbef71812448b4c65656bc667;hp=06816c233d6104c238e587e72899867ac39c1d82;hpb=730f75a099f82d21855442a76a699b36acb89bbb;p=ffmpeg diff --git a/libavcodec/dcaenc.h b/libavcodec/dcaenc.h index 06816c233d6..63fdaf074eb 100644 --- a/libavcodec/dcaenc.h +++ b/libavcodec/dcaenc.h @@ -24,6 +24,8 @@ #include +#include "dcamath.h" + typedef struct { int32_t m; int32_t e; @@ -144,4 +146,13 @@ static const int8_t channel_reorder_nolfe[16][9] = { { 3, 2, 4, 0, 1, 5, 7, 6, -1 }, }; +static inline int32_t quantize_value(int32_t value, softfloat quant) +{ + int32_t offset = 1 << (quant.e - 1); + + value = mul32(value, quant.m) + offset; + value = value >> quant.e; + return value; +} + #endif /* AVCODEC_DCAENC_H */