Skip to content

Commit

Permalink
Обновление openjpeg git-v2.4.0-89-g6a29f5a9;
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksoid1978 committed Mar 13, 2022
1 parent 2359222 commit 3340170
Show file tree
Hide file tree
Showing 27 changed files with 3,505 additions and 173 deletions.
1 change: 1 addition & 0 deletions docs/Changelog.Rus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ MP4Splitter
libflac git-1.3.3-93-ga2fe43f6;
Little-CMS git-lcms2.13.1-6-g8ab8932;
MediaInfo git-v21.09-141-g7545cdfe1;
openjpeg git-v2.4.0-89-g6a29f5a9;
rapidjson git-v1.1.0-685-ge4bde977;

1.6.1
Expand Down
1 change: 1 addition & 0 deletions docs/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Updated libraries:
libflac git-1.3.3-93-ga2fe43f6;
Little-CMS git-lcms2.13.1-6-g8ab8932;
MediaInfo git-v21.09-141-g7545cdfe1;
openjpeg git-v2.4.0-89-g6a29f5a9;
rapidjson git-v1.1.0-685-ge4bde977;


Expand Down
2 changes: 1 addition & 1 deletion src/ExtLib/openjpeg/cio.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ typedef struct opj_stream_private {
opj_stream_seek_fn m_seek_fn;

/**
* Actual data stored into the stream if readed from. Data is read by chunk of fixed size.
* Actual data stored into the stream if read from. Data is read by chunk of fixed size.
* you should never access this data directly.
*/
OPJ_BYTE * m_stored_data;
Expand Down
29 changes: 20 additions & 9 deletions src/ExtLib/openjpeg/dwt.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ static void opj_idwt53_h_cas0(OPJ_INT32* tmp,
s0n = s1n - ((d1c + d1n + 2) >> 2);

tmp[i ] = s0c;
tmp[i + 1] = d1c + ((s0c + s0n) >> 1);
tmp[i + 1] = opj_int_add_no_overflow(d1c, opj_int_add_no_overflow(s0c,
s0n) >> 1);
}

tmp[i] = s0n;
Expand Down Expand Up @@ -450,7 +451,7 @@ static void opj_idwt53_h_cas1(OPJ_INT32* tmp,

dn = in_odd[j] - ((s1 + s2 + 2) >> 2);
tmp[i ] = dc;
tmp[i + 1] = s1 + ((dn + dc) >> 1);
tmp[i + 1] = opj_int_add_no_overflow(s1, opj_int_add_no_overflow(dn, dc) >> 1);

dc = dn;
s1 = s2;
Expand Down Expand Up @@ -512,7 +513,7 @@ static void opj_idwt53_h(const opj_dwt_t *dwt,

#if (defined(__SSE2__) || defined(__AVX2__)) && !defined(STANDARD_SLOW_VERSION)

/* Conveniency macros to improve the readabilty of the formulas */
/* Conveniency macros to improve the readability of the formulas */
#if __AVX2__
#define VREG __m256i
#define LOAD_CST(x) _mm256_set1_epi32(x)
Expand Down Expand Up @@ -796,10 +797,12 @@ static void opj_idwt3_v_cas0(OPJ_INT32* tmp,
s1n = tiledp_col[(OPJ_SIZE_T)(j + 1) * stride];
d1n = tiledp_col[(OPJ_SIZE_T)(sn + j + 1) * stride];

s0n = s1n - ((d1c + d1n + 2) >> 2);
s0n = opj_int_sub_no_overflow(s1n,
opj_int_add_no_overflow(opj_int_add_no_overflow(d1c, d1n), 2) >> 2);

tmp[i ] = s0c;
tmp[i + 1] = d1c + ((s0c + s0n) >> 1);
tmp[i + 1] = opj_int_add_no_overflow(d1c, opj_int_add_no_overflow(s0c,
s0n) >> 1);
}

tmp[i] = s0n;
Expand Down Expand Up @@ -2343,10 +2346,13 @@ static void opj_dwt_decode_partial_1(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn,
OPJ_S(0) /= 2;
} else {
for (i = win_l_x0; i < win_l_x1; i++) {
OPJ_D(i) -= (OPJ_SS_(i) + OPJ_SS_(i + 1) + 2) >> 2;
OPJ_D(i) = opj_int_sub_no_overflow(OPJ_D(i),
opj_int_add_no_overflow(opj_int_add_no_overflow(OPJ_SS_(i), OPJ_SS_(i + 1)),
2) >> 2);
}
for (i = win_h_x0; i < win_h_x1; i++) {
OPJ_S(i) += (OPJ_DD_(i) + OPJ_DD_(i - 1)) >> 1;
OPJ_S(i) = opj_int_add_no_overflow(OPJ_S(i),
opj_int_add_no_overflow(OPJ_DD_(i), OPJ_DD_(i - 1)) >> 1);
}
}
}
Expand Down Expand Up @@ -2484,12 +2490,17 @@ static void opj_dwt_decode_partial_1_parallel(OPJ_INT32 *a,
} else {
for (i = win_l_x0; i < win_l_x1; i++) {
for (off = 0; off < 4; off++) {
OPJ_D_off(i, off) -= (OPJ_SS__off(i, off) + OPJ_SS__off(i + 1, off) + 2) >> 2;
OPJ_D_off(i, off) = opj_int_sub_no_overflow(
OPJ_D_off(i, off),
opj_int_add_no_overflow(
opj_int_add_no_overflow(OPJ_SS__off(i, off), OPJ_SS__off(i + 1, off)), 2) >> 2);
}
}
for (i = win_h_x0; i < win_h_x1; i++) {
for (off = 0; off < 4; off++) {
OPJ_S_off(i, off) += (OPJ_DD__off(i, off) + OPJ_DD__off(i - 1, off)) >> 1;
OPJ_S_off(i, off) = opj_int_add_no_overflow(
OPJ_S_off(i, off),
opj_int_add_no_overflow(OPJ_DD__off(i, off), OPJ_DD__off(i - 1, off)) >> 1);
}
}
}
Expand Down
Loading

0 comments on commit 3340170

Please sign in to comment.