aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/jpeg2000dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-01 10:01:33 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-07-02 20:05:47 +0200
commit53d5d89c1b7534205e5f825918701dda56d18896 (patch)
treee9555ce1af350b21add33f15776d694d3f142f54 /libavcodec/jpeg2000dec.c
parent64f6570c6e2c5a0344383e89c7897809f0c6e1f1 (diff)
downloadffmpeg-53d5d89c1b7534205e5f825918701dda56d18896.tar.gz
jpeg2000: Speed up jpeg2000_decode_tile()
Skip processing bands with dimension set to 0. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/jpeg2000dec.c')
-rw-r--r--libavcodec/jpeg2000dec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 08c8c4df97..6a300bd8f5 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1118,6 +1118,10 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
int cblkno = 0, bandpos;
bandpos = bandno + (reslevelno > 0);
+ if (band->coord[0][0] == band->coord[0][1] ||
+ band->coord[1][0] == band->coord[1][1])
+ continue;
+
nb_precincts = rlevel->num_precincts_x * rlevel->num_precincts_y;
/* Loop on precincts */
for (precno = 0; precno < nb_precincts; precno++) {