You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/exr: reindent after the previous change
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@ -1112,6 +1112,11 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
|
|||||||
|
|
||||||
for (int y = 0; y < td->ysize; y += 8) {
|
for (int y = 0; y < td->ysize; y += 8) {
|
||||||
for (int x = 0; x < td->xsize; x += 8) {
|
for (int x = 0; x < td->xsize; x += 8) {
|
||||||
|
const int o = s->nb_channels == 4;
|
||||||
|
float *yb = td->block[0];
|
||||||
|
float *ub = td->block[1];
|
||||||
|
float *vb = td->block[2];
|
||||||
|
|
||||||
memset(td->block, 0, sizeof(td->block));
|
memset(td->block, 0, sizeof(td->block));
|
||||||
|
|
||||||
for (int j = 0; j < 3; j++) {
|
for (int j = 0; j < 3; j++) {
|
||||||
@ -1127,36 +1132,31 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
|
|||||||
dct_inverse(block);
|
dct_inverse(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (s->pixel_type == EXR_HALF) {
|
||||||
const int o = s->nb_channels == 4;
|
uint16_t *bo = ((uint16_t *)td->uncompressed_data) +
|
||||||
float *yb = td->block[0];
|
y * td->xsize * s->nb_channels + td->xsize * (o + 0) + x;
|
||||||
float *ub = td->block[1];
|
uint16_t *go = ((uint16_t *)td->uncompressed_data) +
|
||||||
float *vb = td->block[2];
|
y * td->xsize * s->nb_channels + td->xsize * (o + 1) + x;
|
||||||
if (s->pixel_type == EXR_HALF) {
|
uint16_t *ro = ((uint16_t *)td->uncompressed_data) +
|
||||||
uint16_t *bo = ((uint16_t *)td->uncompressed_data) +
|
y * td->xsize * s->nb_channels + td->xsize * (o + 2) + x;
|
||||||
y * td->xsize * s->nb_channels + td->xsize * (o + 0) + x;
|
|
||||||
uint16_t *go = ((uint16_t *)td->uncompressed_data) +
|
|
||||||
y * td->xsize * s->nb_channels + td->xsize * (o + 1) + x;
|
|
||||||
uint16_t *ro = ((uint16_t *)td->uncompressed_data) +
|
|
||||||
y * td->xsize * s->nb_channels + td->xsize * (o + 2) + x;
|
|
||||||
|
|
||||||
for (int yy = 0; yy < 8; yy++) {
|
for (int yy = 0; yy < 8; yy++) {
|
||||||
for (int xx = 0; xx < 8; xx++) {
|
for (int xx = 0; xx < 8; xx++) {
|
||||||
const int idx = xx + yy * 8;
|
const int idx = xx + yy * 8;
|
||||||
float b, g, r;
|
float b, g, r;
|
||||||
|
|
||||||
convert(yb[idx], ub[idx], vb[idx], &b, &g, &r);
|
convert(yb[idx], ub[idx], vb[idx], &b, &g, &r);
|
||||||
|
|
||||||
bo[xx] = float2half(av_float2int(to_linear(b, 1.f)), &s->f2h_tables);
|
bo[xx] = float2half(av_float2int(to_linear(b, 1.f)), &s->f2h_tables);
|
||||||
go[xx] = float2half(av_float2int(to_linear(g, 1.f)), &s->f2h_tables);
|
go[xx] = float2half(av_float2int(to_linear(g, 1.f)), &s->f2h_tables);
|
||||||
ro[xx] = float2half(av_float2int(to_linear(r, 1.f)), &s->f2h_tables);
|
ro[xx] = float2half(av_float2int(to_linear(r, 1.f)), &s->f2h_tables);
|
||||||
}
|
|
||||||
|
|
||||||
bo += td->xsize * s->nb_channels;
|
|
||||||
go += td->xsize * s->nb_channels;
|
|
||||||
ro += td->xsize * s->nb_channels;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
bo += td->xsize * s->nb_channels;
|
||||||
|
go += td->xsize * s->nb_channels;
|
||||||
|
ro += td->xsize * s->nb_channels;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
float *bo = ((float *)td->uncompressed_data) +
|
float *bo = ((float *)td->uncompressed_data) +
|
||||||
y * td->xsize * s->nb_channels + td->xsize * (o + 0) + x;
|
y * td->xsize * s->nb_channels + td->xsize * (o + 0) + x;
|
||||||
float *go = ((float *)td->uncompressed_data) +
|
float *go = ((float *)td->uncompressed_data) +
|
||||||
@ -1179,7 +1179,6 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
|
|||||||
go += td->xsize * s->nb_channels;
|
go += td->xsize * s->nb_channels;
|
||||||
ro += td->xsize * s->nb_channels;
|
ro += td->xsize * s->nb_channels;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1197,18 +1196,18 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
|
|||||||
ao[x] = ai0[x] | (ai1[x] << 8);
|
ao[x] = ai0[x] | (ai1[x] << 8);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int y = 0; y < td->ysize && td->rle_raw_data; y++) {
|
for (int y = 0; y < td->ysize && td->rle_raw_data; y++) {
|
||||||
uint32_t *ao = ((uint32_t *)td->uncompressed_data) + y * td->xsize * s->nb_channels;
|
uint32_t *ao = ((uint32_t *)td->uncompressed_data) + y * td->xsize * s->nb_channels;
|
||||||
uint8_t *ai0 = td->rle_raw_data + y * td->xsize;
|
uint8_t *ai0 = td->rle_raw_data + y * td->xsize;
|
||||||
uint8_t *ai1 = td->rle_raw_data + y * td->xsize + rle_raw_size / 2;
|
uint8_t *ai1 = td->rle_raw_data + y * td->xsize + rle_raw_size / 2;
|
||||||
|
|
||||||
for (int x = 0; x < td->xsize; x++) {
|
for (int x = 0; x < td->xsize; x++) {
|
||||||
uint16_t ha = ai0[x] | (ai1[x] << 8);
|
uint16_t ha = ai0[x] | (ai1[x] << 8);
|
||||||
|
|
||||||
ao[x] = half2float(ha, &s->h2f_tables);
|
ao[x] = half2float(ha, &s->h2f_tables);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2076,20 +2075,20 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
|
|||||||
|
|
||||||
switch (s->pixel_type) {
|
switch (s->pixel_type) {
|
||||||
case EXR_HALF:
|
case EXR_HALF:
|
||||||
if (s->channel_offsets[3] >= 0) {
|
if (s->channel_offsets[3] >= 0) {
|
||||||
if (!s->is_luma) {
|
if (!s->is_luma) {
|
||||||
avctx->pix_fmt = AV_PIX_FMT_GBRAPF16;
|
avctx->pix_fmt = AV_PIX_FMT_GBRAPF16;
|
||||||
} else {
|
|
||||||
avctx->pix_fmt = AV_PIX_FMT_YAF16;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (!s->is_luma) {
|
avctx->pix_fmt = AV_PIX_FMT_YAF16;
|
||||||
avctx->pix_fmt = AV_PIX_FMT_GBRPF16;
|
|
||||||
} else {
|
|
||||||
avctx->pix_fmt = AV_PIX_FMT_GRAYF16;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
} else {
|
||||||
|
if (!s->is_luma) {
|
||||||
|
avctx->pix_fmt = AV_PIX_FMT_GBRPF16;
|
||||||
|
} else {
|
||||||
|
avctx->pix_fmt = AV_PIX_FMT_GRAYF16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case EXR_FLOAT:
|
case EXR_FLOAT:
|
||||||
if (s->channel_offsets[3] >= 0) {
|
if (s->channel_offsets[3] >= 0) {
|
||||||
if (!s->is_luma) {
|
if (!s->is_luma) {
|
||||||
|
Reference in New Issue
Block a user