summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-30 14:11:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-30 14:18:53 +0200
commit8bedbb82cee4463a43e60eb22674c8bf927280ef (patch)
treea2c5e516bbb25d35fc0fd3b93ebcb4dc4578c28e /libavcodec/jpeg2000.h
parentb3af9242d013cea1c55f20139316280596332eba (diff)
j2k/jpeg2000: split data pointer in int & float.
This fixes a TODO item and unifies both decoders structures It also fixes undefined behavior due to aliasing violations I choose 2 fields instead of a union because mistakely using the wrong type with a union will lead to hard to debug "wrong output" while with 2 fields mistakely using the wrong type will crash with a null pointer derefernce which is much easier to debug Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000.h')
-rw-r--r--libavcodec/jpeg2000.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h
index 274bae96c5..ff313b59b5 100644
--- a/libavcodec/jpeg2000.h
+++ b/libavcodec/jpeg2000.h
@@ -192,13 +192,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;