opj_t1_dec_sigpass_raw/opj_t1_dec_refpass_raw: harmonize style with mqc methods

This commit is contained in:
Even Rouault 2017-06-02 19:22:15 +02:00
parent 532243f1fd
commit 9a9b06911e
1 changed files with 75 additions and 89 deletions

View File

@ -542,66 +542,59 @@ static void opj_t1_dec_sigpass_raw(
{ {
OPJ_INT32 one, half, oneplushalf; OPJ_INT32 one, half, oneplushalf;
OPJ_UINT32 i, j, k; OPJ_UINT32 i, j, k;
OPJ_INT32 *data1 = t1->data; OPJ_INT32 *data = t1->data;
opj_flag_t *flagsp = &T1_FLAGS(0, 0); opj_flag_t *flagsp = &T1_FLAGS(0, 0);
const OPJ_UINT32 l_w = t1->w;
one = 1 << bpno; one = 1 << bpno;
half = one >> 1; half = one >> 1;
oneplushalf = one | half; oneplushalf = one | half;
for (k = 0; k < (t1->h & ~3U); k += 4) { for (k = 0; k < (t1->h & ~3U); k += 4, flagsp += 2, data += 3 * l_w) {
for (i = 0; i < t1->w; ++i) { for (i = 0; i < l_w; ++i, ++flagsp, ++data) {
OPJ_INT32* data2 = data1 + i; opj_flag_t flags = *flagsp;
opj_t1_dec_sigpass_step_raw( if (flags != 0) {
t1, opj_t1_dec_sigpass_step_raw(
flagsp, t1,
data2, flagsp,
oneplushalf, data,
cblksty & J2K_CCP_CBLKSTY_VSC, /* vsc */ oneplushalf,
0U); cblksty & J2K_CCP_CBLKSTY_VSC, /* vsc */
data2 += t1->w; 0U);
opj_t1_dec_sigpass_step_raw( opj_t1_dec_sigpass_step_raw(
t1, t1,
flagsp, flagsp,
data2, data + l_w,
oneplushalf, oneplushalf,
OPJ_FALSE, /* vsc */ OPJ_FALSE, /* vsc */
1U); 1U);
data2 += t1->w; opj_t1_dec_sigpass_step_raw(
opj_t1_dec_sigpass_step_raw( t1,
t1, flagsp,
flagsp, data + 2 * l_w,
data2, oneplushalf,
oneplushalf, OPJ_FALSE, /* vsc */
OPJ_FALSE, /* vsc */ 2U);
2U); opj_t1_dec_sigpass_step_raw(
data2 += t1->w; t1,
opj_t1_dec_sigpass_step_raw( flagsp,
t1, data + 3 * l_w,
flagsp, oneplushalf,
data2, OPJ_FALSE, /* vsc */
oneplushalf, 3U);
OPJ_FALSE, /* vsc */ }
3U);
data2 += t1->w;
flagsp ++;
} }
data1 += t1->w << 2;
flagsp += 2;
} }
if (k < t1->h) { if (k < t1->h) {
for (i = 0; i < t1->w; ++i) { for (i = 0; i < l_w; ++i, ++flagsp, ++data) {
OPJ_INT32* data2 = data1 + i;
for (j = 0; j < t1->h - k; ++j) { for (j = 0; j < t1->h - k; ++j) {
opj_t1_dec_sigpass_step_raw( opj_t1_dec_sigpass_step_raw(
t1, t1,
flagsp, flagsp,
data2, data + j * l_w,
oneplushalf, oneplushalf,
cblksty & J2K_CCP_CBLKSTY_VSC, /* vsc */ cblksty & J2K_CCP_CBLKSTY_VSC, /* vsc */
j); j);
data2 += t1->w;
} }
flagsp ++;
} }
} }
} }
@ -898,59 +891,52 @@ static void opj_t1_dec_refpass_raw(
{ {
OPJ_INT32 one, poshalf; OPJ_INT32 one, poshalf;
OPJ_UINT32 i, j, k; OPJ_UINT32 i, j, k;
OPJ_INT32 *data1 = t1->data; OPJ_INT32 *data = t1->data;
opj_flag_t *flagsp = &T1_FLAGS(0, 0); opj_flag_t *flagsp = &T1_FLAGS(0, 0);
const OPJ_UINT32 l_w = t1->w;
one = 1 << bpno; one = 1 << bpno;
poshalf = one >> 1; poshalf = one >> 1;
for (k = 0; k < (t1->h & ~3U); k += 4) { for (k = 0; k < (t1->h & ~3U); k += 4, flagsp += 2, data += 3 * l_w) {
for (i = 0; i < t1->w; ++i) { for (i = 0; i < l_w; ++i, ++flagsp, ++data) {
OPJ_INT32 *data2 = data1 + i; opj_flag_t flags = *flagsp;
opj_t1_dec_refpass_step_raw( if (flags != 0) {
t1,
flagsp,
data2,
poshalf,
0U);
data2 += t1->w;
opj_t1_dec_refpass_step_raw(
t1,
flagsp,
data2,
poshalf,
1U);
data2 += t1->w;
opj_t1_dec_refpass_step_raw(
t1,
flagsp,
data2,
poshalf,
2U);
data2 += t1->w;
opj_t1_dec_refpass_step_raw(
t1,
flagsp,
data2,
poshalf,
3U);
data2 += t1->w;
flagsp ++;
}
data1 += t1->w << 2;
flagsp += 2;
}
if (k < t1->h) {
for (i = 0; i < t1->w; ++i) {
OPJ_INT32 *data2 = data1 + i;
for (j = k; j < t1->h; ++j) {
opj_t1_dec_refpass_step_raw( opj_t1_dec_refpass_step_raw(
t1, t1,
flagsp, flagsp,
data2, data,
poshalf, poshalf,
j - k); 0U);
data2 += t1->w; opj_t1_dec_refpass_step_raw(
t1,
flagsp,
data + l_w,
poshalf,
1U);
opj_t1_dec_refpass_step_raw(
t1,
flagsp,
data + 2 * l_w,
poshalf,
2U);
opj_t1_dec_refpass_step_raw(
t1,
flagsp,
data + 3 * l_w,
poshalf,
3U);
}
}
}
if (k < t1->h) {
for (i = 0; i < l_w; ++i, ++flagsp, ++data) {
for (j = 0; j < t1->h - k; ++j) {
opj_t1_dec_refpass_step_raw(
t1,
flagsp,
data + j * l_w,
poshalf,
j);
} }
flagsp ++;
} }
} }
} }