Skip to content

Commit

Permalink
faw処理で異常終了する場合があったのを修正。
Browse files Browse the repository at this point in the history
  • Loading branch information
rigaya committed Jun 20, 2023
1 parent d7f9fcd commit b6d1c17
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
6 changes: 5 additions & 1 deletion VCECore/rgy_faw.cpp
Expand Up @@ -206,7 +206,11 @@ uint32_t RGYFAWBitstream::aacFrameSize() const {
}

void RGYFAWBitstream::addOffset(size_t offset) {
bufferLength -= offset;
if (bufferLength < offset) {
bufferLength = 0;
} else {
bufferLength -= offset;
}
if (bufferLength == 0) {
bufferOffset = 0;
} else {
Expand Down
10 changes: 6 additions & 4 deletions VCECore/rgy_memmem.h
Expand Up @@ -98,7 +98,7 @@ static RGY_FORCEINLINE size_t rgy_memmem_avx2_imp(const void *data_, const size_
const uint8_t *target = (const uint8_t *)target_;
const __m256i target_first = _mm256_set1_epi8(target[0]);
const __m256i target_last = _mm256_set1_epi8(target[target_size - 1]);
const int64_t fin64 = (int64_t)data_size - (int64_t)target_size + 1 - 32; // r1の32byteロードが安全に行える限界
const int64_t fin64 = (int64_t)data_size - (int64_t)(target_size + 32 - 1); // r1の32byteロードが安全に行える限界
size_t i = 0;
if (fin64 > 0) {
const size_t fin = (size_t)fin64;
Expand All @@ -125,7 +125,8 @@ static RGY_FORCEINLINE size_t rgy_memmem_avx2_imp(const void *data_, const size_
uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(_mm256_cmpeq_epi8(r0, target_first), _mm256_cmpeq_epi8(r1, target_last)));
while (mask != 0) {
const auto j = CTZ32(mask);
if (memcmp(data + i + j + 1, target + 1, target_size - 2) == 0) {
if ((i + j + target_size - 1 < data_size)
&& memcmp(data + i + j + 1, target + 1, target_size - 2) == 0) {
const auto ret = i + j;
return ret < data_size ? ret : RGY_MEMMEM_NOT_FOUND;
}
Expand Down Expand Up @@ -177,7 +178,7 @@ static RGY_FORCEINLINE size_t rgy_memmem_avx512_imp(const void *data_, const siz
const uint8_t *target = (const uint8_t *)target_;
const __m512i target_first = _mm512_set1_epi8(target[0]);
const __m512i target_last = _mm512_set1_epi8(target[target_size - 1]);
const int64_t fin64 = (int64_t)data_size - (int64_t)target_size + 1 - 64; // r1の64byteロードが安全に行える限界
const int64_t fin64 = (int64_t)data_size - (int64_t)(target_size + 64 - 1); // r1の64byteロードが安全に行える限界
size_t i = 0;
if (fin64 > 0) {
const size_t fin = (size_t)fin64;
Expand All @@ -204,7 +205,8 @@ static RGY_FORCEINLINE size_t rgy_memmem_avx512_imp(const void *data_, const siz
uint64_t mask = _mm512_mask_cmpeq_epi8_mask(_mm512_cmpeq_epi8_mask(r0, target_first), r1, target_last);
while (mask != 0) {
const auto j = CTZ64(mask);
if (memcmp(data + i + j + 1, target + 1, target_size - 2) == 0) {
if ((i + j + target_size - 1 < data_size)
&& memcmp(data + i + j + 1, target + 1, target_size - 2) == 0) {
const auto ret = i + j;
return ret;
}
Expand Down
6 changes: 3 additions & 3 deletions VCECore/rgy_version.h
Expand Up @@ -29,9 +29,9 @@
#ifndef __RGY_VERSION_H__
#define __RGY_VERSION_H__

#define VER_FILEVERSION 0,8,14,0
#define VER_STR_FILEVERSION "8.14"
#define VER_STR_FILEVERSION_TCHAR _T("8.14")
#define VER_FILEVERSION 0,8,15,0
#define VER_STR_FILEVERSION "8.15"
#define VER_STR_FILEVERSION_TCHAR _T("8.15")


#ifdef _M_IX86
Expand Down
4 changes: 4 additions & 0 deletions VCEEnc/VCEEnc_readme.txt
Expand Up @@ -181,6 +181,10 @@ Radeon RX550
今後の更新で設定ファイルの互換性がなくなるかもしれません。

【どうでもいいメモ】
2023.06.20 (8.15)
[VCEEnc.auo]
- VCEEnc 8.14のfaw処理に問題があり、異常終了してしまうケースがあったのを修正。

2023.06.07 (8.14)
[VCEEncC]
- SAR比使用時の出力を改善。
Expand Down

0 comments on commit b6d1c17

Please sign in to comment.