Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-12-16 07:44:54 +0300
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-12-16 15:57:26 +0300
commit83a04f103d387a8b7f574d97d340d90f42fc18de (patch)
tree740d3c0f8089daa3a5742d0bd7020259e4a401ad /libavcodec/jpeg2000.c
parent4fa6f09c2c024cb6a9697d2d63b0be04a0630267 (diff)
lavc: move exp2fi to ff_exp2fi in internal.h
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavcodec/jpeg2000.c')
-rw-r--r--libavcodec/jpeg2000.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index afd0966103..b5b2dbf220 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -31,6 +31,7 @@
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "avcodec.h"
+#include "internal.h"
#include "jpeg2000.h"
#define SHL(a, n) ((n) >= 0 ? (a) << (n) : (a) >> -(n))
@@ -192,21 +193,6 @@ void ff_jpeg2000_set_significance(Jpeg2000T1Context *t1, int x, int y,
// static const uint8_t lut_gain[2][4] = { { 0, 0, 0, 0 }, { 0, 1, 1, 2 } }; (unused)
-static inline float exp2fi(int x) {
- /* Normal range */
- if (-126 <= x && x <= 128)
- return av_int2float(x+127 << 23);
- /* Too large */
- else if (x > 128)
- return INFINITY;
- /* Subnormal numbers */
- else if (x > -150)
- return av_int2float(1 << (x+149));
- /* Negligibly small */
- else
- return 0;
-}
-
static void init_band_stepsize(AVCodecContext *avctx,
Jpeg2000Band *band,
Jpeg2000CodingStyle *codsty,
@@ -236,7 +222,7 @@ static void init_band_stepsize(AVCodecContext *avctx,
* R_b = R_I + log2 (gain_b )
* see ISO/IEC 15444-1:2002 E.1.1 eqn. E-3 and E-4 */
gain = cbps;
- band->f_stepsize = exp2fi(gain - qntsty->expn[gbandno]);
+ band->f_stepsize = ff_exp2fi(gain - qntsty->expn[gbandno]);
band->f_stepsize *= qntsty->mant[gbandno] / 2048.0 + 1.0;
break;
default: