Skip to content

Commit

Permalink
fix clang build
Browse files Browse the repository at this point in the history
  • Loading branch information
K-os committed Jun 3, 2024
1 parent c0bce23 commit 2ab0b49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions source/Lib/FilmGrain/FilmGrainImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,4 +381,13 @@ void FilmGrainImpl::set_chroma_subsampling( int subx, int suby )
csuby = suby;
}

FilmGrainImpl::FilmGrainImpl()
{
memset( pattern, 0, sizeof( pattern ) );
memset( sLUT, 0, sizeof( sLUT ) );
memset( pLUT, 0, sizeof( pLUT ) );
memset( grain, 0, sizeof( grain ) );
memset( scale, 0, sizeof( scale ) );
}

} // namespace vvdec
8 changes: 5 additions & 3 deletions source/Lib/FilmGrain/FilmGrainImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ class FilmGrainImpl
{
// Note: declarations optimized for code readability; e.g. pattern storage in
// actual hardware implementation would differ significantly
int8_t pattern[2][VFGS_MAX_PATTERNS + 1][64][64] = { 0, }; // +1 to simplify interpolation code
uint8_t sLUT[3][256] = { 0, };
uint8_t pLUT[3][256] = { 0, };
int8_t pattern[2][VFGS_MAX_PATTERNS + 1][64][64]; // +1 to simplify interpolation code
uint8_t sLUT[3][256];
uint8_t pLUT[3][256];

uint32_t rnd = 0xdeadbeef;
uint32_t rnd_up = 0xdeadbeef;
Expand All @@ -116,6 +116,8 @@ class FilmGrainImpl
void add_grain_block( void* I, int c, int x, int y, int width );

protected:
FilmGrainImpl();

void set_luma_pattern( int index, int8_t* P );
void set_chroma_pattern( int index, int8_t* P );
void set_scale_lut( int c, uint8_t lut[] );
Expand Down

0 comments on commit 2ab0b49

Please sign in to comment.