Commit 99a28333 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_traspose: move switch out of loop

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 38155b47
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment