[FFmpeg-cvslog] avcodec/jpeg2000: Improve right bottom precinct positions

Michael Niedermayer git at videolan.org
Thu Jun 25 00:26:32 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jun 24 23:50:48 2015 +0200| [67fc898243736d01ae03113ade4e8eace59ceb53] | committer: Michael Niedermayer

avcodec/jpeg2000: Improve right bottom precinct positions

Fixes Ticket4656

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=67fc898243736d01ae03113ade4e8eace59ceb53
---

 libavcodec/jpeg2000.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index b333aad..ebf8320 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -395,23 +395,23 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
                 /* TODO: Verify with previous count of codeblocks per band */
 
                 /* Compute P_x0 */
-                prec->coord[0][0] = ((band->coord[0][0] >> reslevel->log2_prec_width) + precno % reslevel->num_precincts_x) *
+                prec->coord[0][0] = ((band->coord[0][0] >> log2_band_prec_width) + precno % reslevel->num_precincts_x) *
                                     (1 << log2_band_prec_width);
-                prec->coord[0][0] = FFMAX(prec->coord[0][0], band->coord[0][0]);
 
                 /* Compute P_y0 */
-                prec->coord[1][0] = ((band->coord[1][0] >> reslevel->log2_prec_height) + precno / reslevel->num_precincts_x) *
+                prec->coord[1][0] = ((band->coord[1][0] >> log2_band_prec_height) + precno / reslevel->num_precincts_x) *
                                     (1 << log2_band_prec_height);
-                prec->coord[1][0] = FFMAX(prec->coord[1][0], band->coord[1][0]);
 
                 /* Compute P_x1 */
                 prec->coord[0][1] = prec->coord[0][0] +
                                     (1 << log2_band_prec_width);
+                prec->coord[0][0] = FFMAX(prec->coord[0][0], band->coord[0][0]);
                 prec->coord[0][1] = FFMIN(prec->coord[0][1], band->coord[0][1]);
 
                 /* Compute P_y1 */
                 prec->coord[1][1] = prec->coord[1][0] +
                                     (1 << log2_band_prec_height);
+                prec->coord[1][0] = FFMAX(prec->coord[1][0], band->coord[1][0]);
                 prec->coord[1][1] = FFMIN(prec->coord[1][1], band->coord[1][1]);
 
                 prec->nb_codeblocks_width =



More information about the ffmpeg-cvslog mailing list