summaryrefslogtreecommitdiff
path: root/libavcodec/tiff.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-12-31 01:53:22 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2011-12-31 01:53:22 +0100
commitb46fb615c441801f1d6949fac002d9f2ea6a8e15 (patch)
tree078c8ccf0decc4b56877e22df8bd6b585b9a783d /libavcodec/tiff.c
parent1a6a088f7c7b164042ad16d43d05543ce1bacfa4 (diff)
tiff.c: Use switch / case instead of if / else where appropriate.
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r--libavcodec/tiff.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 1060a4403e..ba838df2f3 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -108,19 +108,22 @@ static void av_always_inline horizontal_fill(unsigned int bpp, uint8_t* dst,
{
int i;
- if (bpp == 2) {
+ switch (bpp) {
+ case 2:
for (i = 0; i < width; i++) {
dst[(i+offset)*4+0] = (usePtr ? src[i] : c) >> 6;
dst[(i+offset)*4+1] = (usePtr ? src[i] : c) >> 4 & 0x3;
dst[(i+offset)*4+2] = (usePtr ? src[i] : c) >> 2 & 0x3;
dst[(i+offset)*4+3] = (usePtr ? src[i] : c) & 0x3;
}
- } else if (bpp == 4) {
+ break;
+ case 4:
for (i = 0; i < width; i++) {
dst[(i+offset)*2+0] = (usePtr ? src[i] : c) >> 4;
dst[(i+offset)*2+1] = (usePtr ? src[i] : c) & 0xF;
}
- } else {
+ break;
+ default:
if (usePtr) {
memcpy(dst + offset, src, width);
} else {