Skip to content

Commit

Permalink
Run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
wantehchang committed Mar 17, 2022
1 parent 7d12e6b commit ca72883
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/avif.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ avifResult avifImageSetViewRect(avifImage * dstImage, const avifImage * srcImage
if (srcImage->yuvRowBytes[yuvPlane]) {
const size_t planeX = (yuvPlane == AVIF_CHAN_Y) ? rect->x : (rect->x >> formatInfo.chromaShiftX);
const size_t planeY = (yuvPlane == AVIF_CHAN_Y) ? rect->y : (rect->y >> formatInfo.chromaShiftY);
dstImage->yuvPlanes[yuvPlane] = srcImage->yuvPlanes[yuvPlane] + planeY * srcImage->yuvRowBytes[yuvPlane] + planeX * pixelBytes;
dstImage->yuvPlanes[yuvPlane] =
srcImage->yuvPlanes[yuvPlane] + planeY * srcImage->yuvRowBytes[yuvPlane] + planeX * pixelBytes;
dstImage->yuvRowBytes[yuvPlane] = srcImage->yuvRowBytes[yuvPlane];
}
}
Expand Down
13 changes: 10 additions & 3 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -4062,7 +4062,11 @@ uint32_t avifDecoderNearestKeyframe(const avifDecoder * decoder, uint32_t frameI
}

// Returns the number of available rows in decoder->image given a color or alpha subimage.
static uint32_t avifGetDecodedRowCount(const avifDecoder * decoder, const avifImageGrid * grid, uint32_t firstTileIndex, uint32_t tileCount, uint32_t decodedTileCount)
static uint32_t avifGetDecodedRowCount(const avifDecoder * decoder,
const avifImageGrid * grid,
uint32_t firstTileIndex,
uint32_t tileCount,
uint32_t decodedTileCount)
{
if (decodedTileCount == tileCount) {
return decoder->image->height;
Expand All @@ -4083,8 +4087,11 @@ static uint32_t avifGetDecodedRowCount(const avifDecoder * decoder, const avifIm

uint32_t avifDecoderDecodedRowCount(const avifDecoder * decoder)
{
const uint32_t colorRowCount =
avifGetDecodedRowCount(decoder, &decoder->data->colorGrid, /*firstTileIndex=*/0, decoder->data->colorTileCount, decoder->data->decodedColorTileCount);
const uint32_t colorRowCount = avifGetDecodedRowCount(decoder,
&decoder->data->colorGrid,
/*firstTileIndex=*/0,
decoder->data->colorTileCount,
decoder->data->decodedColorTileCount);
const uint32_t alphaRowCount = avifGetDecodedRowCount(decoder,
&decoder->data->alphaGrid,
/*firstTileIndex=*/decoder->data->colorTileCount,
Expand Down

0 comments on commit ca72883

Please sign in to comment.