ffmpeg gfx_conv_c: Style fixes.

This commit is contained in:
Adrien Destugues
2014-12-09 14:59:12 +01:00
parent d5b78822f7
commit 77476b38fe
+38 -38
View File
@@ -160,38 +160,38 @@ YUV444TORGBA8888(uint8 y, uint8 u, uint8 v)
void void
gfx_conv_yuv410p_rgb32_c(AVFrame *in, AVFrame *out, int width, int height) gfx_conv_yuv410p_rgb32_c(AVFrame *in, AVFrame *out, int width, int height)
{ {
uint8 *ybase = (uint8 *)in->data[0]; uint8 *yBase = (uint8 *)in->data[0];
uint8 *ubase = (uint8 *)in->data[1]; uint8 *uBase = (uint8 *)in->data[1];
uint8 *vbase = (uint8 *)in->data[2]; uint8 *vBase = (uint8 *)in->data[2];
uint32 *rgbbase = (uint32 *)out->data[0]; uint32 *rgbBase = (uint32 *)out->data[0];
int uv_index; int uvIndex;
for (int32 i = 0; i < height; i++) { for (int32 i = 0; i < height; i++) {
uv_index = 0; uvIndex = 0;
for (int32 j=0; j < width; j+=4) { for (int32 j=0; j < width; j+=4) {
rgbbase[j] = YUV444TORGBA8888(ybase[j], ubase[uv_index], rgbBase[j] = YUV444TORGBA8888(yBase[j], uBase[uvIndex],
vbase[uv_index]); vBase[uvIndex]);
rgbbase[j + 1] = YUV444TORGBA8888(ybase[j + 1], ubase[uv_index], rgbBase[j + 1] = YUV444TORGBA8888(yBase[j + 1], uBase[uvIndex],
vbase[uv_index]); vBase[uvIndex]);
rgbbase[j + 2] = YUV444TORGBA8888(ybase[j + 2], ubase[uv_index], rgbBase[j + 2] = YUV444TORGBA8888(yBase[j + 2], uBase[uvIndex],
vbase[uv_index]); vBase[uvIndex]);
rgbbase[j + 3] = YUV444TORGBA8888(ybase[j + 3], ubase[uv_index], rgbBase[j + 3] = YUV444TORGBA8888(yBase[j + 3], uBase[uvIndex],
vbase[uv_index]); vBase[uvIndex]);
uv_index++; uvIndex++;
} }
// Advance pointers to next line // Advance pointers to next line
ybase += in->linesize[0]; yBase += in->linesize[0];
if ((i & 3) == 0) { if ((i & 3) == 0) {
// These are the same for 4 lines // These are the same for 4 lines
ubase += in->linesize[1]; uBase += in->linesize[1];
vbase += in->linesize[2]; vBase += in->linesize[2];
} }
rgbbase += out->linesize[0] / 4; rgbBase += out->linesize[0] / 4;
} }
} }
@@ -207,32 +207,32 @@ gfx_conv_yuv411p_rgb32_c(AVFrame *in, AVFrame *out, int width, int height)
void void
gfx_conv_YCbCr422_RGB32_c(AVFrame *in, AVFrame *out, int width, int height) gfx_conv_YCbCr422_RGB32_c(AVFrame *in, AVFrame *out, int width, int height)
{ {
uint8 *ybase = (uint8 *)in->data[0]; uint8 *yBase = (uint8 *)in->data[0];
uint8 *ubase = (uint8 *)in->data[1]; uint8 *uBase = (uint8 *)in->data[1];
uint8 *vbase = (uint8 *)in->data[2]; uint8 *vBase = (uint8 *)in->data[2];
uint32 *rgbbase = (uint32 *)out->data[0];
int uv_index; uint32 *rgbBase = (uint32 *)out->data[0];
int uvIndex;
for (int32 i = 0; i < height; i++) { for (int32 i = 0; i < height; i++) {
uv_index = 0; uvIndex = 0;
for (uint32 j=0; j < width; j+=2) { for (uint32 j=0; j < width; j+=2) {
rgbbase[j] = YUV444TORGBA8888(ybase[j], ubase[uv_index], rgbBase[j] = YUV444TORGBA8888(yBase[j], uBase[uvIndex],
vbase[uv_index]); vBase[uvIndex]);
rgbbase[j + 1] = YUV444TORGBA8888(ybase[j + 1], ubase[uv_index], rgbBase[j + 1] = YUV444TORGBA8888(yBase[j + 1], uBase[uvIndex],
vbase[uv_index]); vBase[uvIndex]);
uv_index++; uvIndex++;
} }
ybase += in->linesize[0]; yBase += in->linesize[0];
ubase += in->linesize[1]; uBase += in->linesize[1];
vbase += in->linesize[2]; vBase += in->linesize[2];
rgbbase += out->linesize[0] / 4; rgbBase += out->linesize[0] / 4;
} }
if (height & 1) { if (height & 1) {