diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-26 00:14:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-26 01:00:17 +0200 |
commit | f1e173049ecc9de03817385ba8962d14cba779db (patch) | |
tree | 3f7b64ee98dc6804b5124d0d414bf5255b0624a5 /libavcodec/jpeg2000.c | |
parent | 8c22143e7e006bb66bc380a874ceb609b62d8997 (diff) | |
download | ffmpeg-f1e173049ecc9de03817385ba8962d14cba779db.tar.gz |
avcodec/jpeg2000: Remove CBLK limit
This also reduces the amount of memory needed
Fixes Ticket4672
The new code seems slightly faster as well, probably due to better cache usage
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000.c')
-rw-r--r-- | libavcodec/jpeg2000.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c index ebf8320f81..7d2b18f70a 100644 --- a/libavcodec/jpeg2000.c +++ b/libavcodec/jpeg2000.c @@ -171,22 +171,22 @@ void ff_jpeg2000_set_significance(Jpeg2000T1Context *t1, int x, int y, { x++; y++; - t1->flags[y][x] |= JPEG2000_T1_SIG; + t1->flags[(y) * t1->stride + x] |= JPEG2000_T1_SIG; if (negative) { - t1->flags[y][x + 1] |= JPEG2000_T1_SIG_W | JPEG2000_T1_SGN_W; - t1->flags[y][x - 1] |= JPEG2000_T1_SIG_E | JPEG2000_T1_SGN_E; - t1->flags[y + 1][x] |= JPEG2000_T1_SIG_N | JPEG2000_T1_SGN_N; - t1->flags[y - 1][x] |= JPEG2000_T1_SIG_S | JPEG2000_T1_SGN_S; + t1->flags[(y) * t1->stride + x + 1] |= JPEG2000_T1_SIG_W | JPEG2000_T1_SGN_W; + t1->flags[(y) * t1->stride + x - 1] |= JPEG2000_T1_SIG_E | JPEG2000_T1_SGN_E; + t1->flags[(y + 1) * t1->stride + x] |= JPEG2000_T1_SIG_N | JPEG2000_T1_SGN_N; + t1->flags[(y - 1) * t1->stride + x] |= JPEG2000_T1_SIG_S | JPEG2000_T1_SGN_S; } else { - t1->flags[y][x + 1] |= JPEG2000_T1_SIG_W; - t1->flags[y][x - 1] |= JPEG2000_T1_SIG_E; - t1->flags[y + 1][x] |= JPEG2000_T1_SIG_N; - t1->flags[y - 1][x] |= JPEG2000_T1_SIG_S; + t1->flags[(y) * t1->stride + x + 1] |= JPEG2000_T1_SIG_W; + t1->flags[(y) * t1->stride + x - 1] |= JPEG2000_T1_SIG_E; + t1->flags[(y + 1) * t1->stride + x] |= JPEG2000_T1_SIG_N; + t1->flags[(y - 1) * t1->stride + x] |= JPEG2000_T1_SIG_S; } - t1->flags[y + 1][x + 1] |= JPEG2000_T1_SIG_NW; - t1->flags[y + 1][x - 1] |= JPEG2000_T1_SIG_NE; - t1->flags[y - 1][x + 1] |= JPEG2000_T1_SIG_SW; - t1->flags[y - 1][x - 1] |= JPEG2000_T1_SIG_SE; + t1->flags[(y + 1) * t1->stride + x + 1] |= JPEG2000_T1_SIG_NW; + t1->flags[(y + 1) * t1->stride + x - 1] |= JPEG2000_T1_SIG_NE; + t1->flags[(y - 1) * t1->stride + x + 1] |= JPEG2000_T1_SIG_SW; + t1->flags[(y - 1) * t1->stride + x - 1] |= JPEG2000_T1_SIG_SE; } static const uint8_t lut_gain[2][4] = { { 0, 0, 0, 0 }, { 0, 1, 1, 2 } }; |