mirror of https://git.ffmpeg.org/ffmpeg.git
checkasm/h264dsp: add missing pixel_mask values
Fixes "runtime error: index 4 out of bounds for type 'uint32_t [3]'" errors
after commit 4ced36744e
.
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
e9741f1a6b
commit
8670615743
|
@ -27,17 +27,17 @@
|
|||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
|
||||
static const uint32_t pixel_mask[3] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff };
|
||||
static const uint32_t pixel_mask[5] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff, 0x0fff0fff, 0x3fff3fff };
|
||||
static const uint32_t pixel_mask_lf[3] = { 0xff0fff0f, 0x01ff000f, 0x03ff000f };
|
||||
|
||||
#define SIZEOF_PIXEL ((bit_depth + 7) / 8)
|
||||
#define SIZEOF_COEF (2 * ((bit_depth + 7) / 8))
|
||||
#define PIXEL_STRIDE 16
|
||||
|
||||
#define randomize_buffers() \
|
||||
#define randomize_buffers(idx) \
|
||||
do { \
|
||||
int x, y; \
|
||||
uint32_t mask = pixel_mask[bit_depth - 8]; \
|
||||
uint32_t mask = pixel_mask[(idx)]; \
|
||||
for (y = 0; y < sz; y++) { \
|
||||
for (x = 0; x < PIXEL_STRIDE; x += 4) { \
|
||||
AV_WN32A(src + y * PIXEL_STRIDE + x, rnd() & mask); \
|
||||
|
@ -189,7 +189,7 @@ static void check_idct(void)
|
|||
bit_depth = depths[i];
|
||||
ff_h264dsp_init(&h, bit_depth, 1);
|
||||
for (sz = 4; sz <= 8; sz += 4) {
|
||||
randomize_buffers();
|
||||
randomize_buffers(i);
|
||||
|
||||
if (sz == 4)
|
||||
dct4x4(coef, bit_depth);
|
||||
|
@ -277,7 +277,7 @@ static void check_idct_multiple(void)
|
|||
int offset = (block_y * 16 + block_x) * SIZEOF_PIXEL;
|
||||
int nnz = rnd() % 3;
|
||||
|
||||
randomize_buffers();
|
||||
randomize_buffers(bit_depth - 8);
|
||||
if (sz == 4)
|
||||
dct4x4(coef, bit_depth);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue