summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-01 10:01:22 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-07-02 20:05:46 +0200
commit5bf208f659703895df7926238dcfa8a8175de36b (patch)
treeb3504da707a0861b79ff75c0d71bb960a3f5b453 /libavcodec/jpeg2000.h
parenta458b91cf4350bb170b4e651c0ada92f0e9dcd84 (diff)
jpeg2000: Use separate fields for int and float codepaths
Split stepsize and data into int and float variants. Eliminates a number of casts and simplifies spotting errors. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/jpeg2000.h')
-rw-r--r--libavcodec/jpeg2000.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h
index 00bfcdda81..0ff652e56d 100644
--- a/libavcodec/jpeg2000.h
+++ b/libavcodec/jpeg2000.h
@@ -178,12 +178,11 @@ typedef struct Jpeg2000Prec {
uint16_t coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
} Jpeg2000Prec; // precinct
-/* TODO: stepsize can be float or integer depending on
- * reversible or irreversible transformation. */
typedef struct Jpeg2000Band {
uint16_t coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
uint16_t log2_cblk_width, log2_cblk_height;
- float stepsize; // quantization stepsize
+ int i_stepsize; // quantization stepsize
+ float f_stepsize; // quantization stepsize
Jpeg2000Prec *prec;
} Jpeg2000Band; // subband
@@ -195,13 +194,11 @@ typedef struct Jpeg2000ResLevel {
Jpeg2000Band *band;
} Jpeg2000ResLevel; // resolution level
-/* TODO: data can be float of integer depending of reversible/irreversible
- * transformation.
- */
typedef struct Jpeg2000Component {
Jpeg2000ResLevel *reslevel;
DWTContext dwt;
- float *data;
+ float *f_data;
+ int *i_data;
uint16_t coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}} -- can be reduced with lowres option
uint16_t coord_o[2][2]; // border coordinates {{x0, x1}, {y0, y1}} -- original values from jpeg2000 headers
} Jpeg2000Component;