diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-14 21:02:06 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-14 23:59:50 +0300 |
commit | a206c13289e6153c910ecb47eba5fc9e1d8fbbc7 (patch) | |
tree | 6d952efff2b98e656046e901d894fe9b1454b516 /libavcodec/jpeg2000.c | |
parent | d9841e53e2eb5aa501d788f9723f0e04ed591a22 (diff) |
avcodec/jpeg2000: Change codeblock coords to same origin as bands
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000.c')
-rw-r--r-- | libavcodec/jpeg2000.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c index b5dd36dff5..d2dbffa858 100644 --- a/libavcodec/jpeg2000.c +++ b/libavcodec/jpeg2000.c @@ -437,22 +437,22 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp, /* Compute coordinates of codeblocks */ /* Compute Cx0*/ - Cx0 = ((prec->coord[0][0] - band->coord[0][0]) >> band->log2_cblk_width) << band->log2_cblk_width; + Cx0 = ((prec->coord[0][0]) >> band->log2_cblk_width) << band->log2_cblk_width; Cx0 = Cx0 + ((cblkno % prec->nb_codeblocks_width) << band->log2_cblk_width); - cblk->coord[0][0] = FFMAX(Cx0, prec->coord[0][0] - band->coord[0][0]); + cblk->coord[0][0] = FFMAX(Cx0, prec->coord[0][0]); /* Compute Cy0*/ - Cy0 = ((prec->coord[1][0] - band->coord[1][0]) >> band->log2_cblk_height) << band->log2_cblk_height; + Cy0 = ((prec->coord[1][0]) >> band->log2_cblk_height) << band->log2_cblk_height; Cy0 = Cy0 + ((cblkno / prec->nb_codeblocks_width) << band->log2_cblk_height); - cblk->coord[1][0] = FFMAX(Cy0, prec->coord[1][0] - band->coord[1][0]); + cblk->coord[1][0] = FFMAX(Cy0, prec->coord[1][0]); /* Compute Cx1 */ cblk->coord[0][1] = FFMIN(Cx0 + (1 << band->log2_cblk_width), - prec->coord[0][1] - band->coord[0][0]); + prec->coord[0][1]); /* Compute Cy1 */ cblk->coord[1][1] = FFMIN(Cy0 + (1 << band->log2_cblk_height), - prec->coord[1][1] - band->coord[1][0]); + prec->coord[1][1]); /* Update code-blocks coordinates according sub-band position */ if ((bandno + !!reslevelno) & 1) { cblk->coord[0][0] += comp->reslevel[reslevelno-1].coord[0][1] - |