avfilter/vf_traspose: move switch out of loop

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2013-09-11 14:56:46 +00:00
parent 38155b47fd
commit 99a283331c

View File

@ -174,38 +174,46 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr,
dstlinesize *= -1;
}
for (y = start; y < end; y++) {
switch (pixstep) {
case 1:
switch (pixstep) {
case 1:
for (y = start; y < end; y++, dst += dstlinesize)
for (x = 0; x < outw; x++)
dst[x] = src[x*srclinesize + y];
break;
case 2:
break;
case 2:
for (y = start; y < end; y++, dst += dstlinesize) {
for (x = 0; x < outw; x++)
*((uint16_t *)(dst + 2*x)) = *((uint16_t *)(src + x*srclinesize + y*2));
break;
case 3:
}
break;
case 3:
for (y = start; y < end; y++, dst += dstlinesize) {
for (x = 0; x < outw; x++) {
int32_t v = AV_RB24(src + x*srclinesize + y*3);
AV_WB24(dst + 3*x, v);
}
break;
case 4:
}
break;
case 4:
for (y = start; y < end; y++, dst += dstlinesize) {
for (x = 0; x < outw; x++)
*((uint32_t *)(dst + 4*x)) = *((uint32_t *)(src + x*srclinesize + y*4));
break;
case 6:
}
break;
case 6:
for (y = start; y < end; y++, dst += dstlinesize) {
for (x = 0; x < outw; x++) {
int64_t v = AV_RB48(src + x*srclinesize + y*6);
AV_WB48(dst + 6*x, v);
}
break;
case 8:
}
break;
case 8:
for (y = start; y < end; y++, dst += dstlinesize) {
for (x = 0; x < outw; x++)
*((uint64_t *)(dst + 8*x)) = *((uint64_t *)(src + x*srclinesize + y*8));
break;
}
dst += dstlinesize;
break;
}
}