avcodec/dvbsubenc: reindent after previous commit

This commit is contained in:
Clément Bœsch 2020-08-18 10:32:50 +02:00
parent 5fc075d53e
commit 80d2a33d83

View File

@ -375,48 +375,48 @@ static int dvbsub_encode(AVCodecContext *avctx, uint8_t *outbuf, int buf_size,
buf_size -= 6 + h->rects[clut_id]->nb_colors * 6;
}
if (buf_size < h->num_rects * 22)
return AVERROR_BUFFER_TOO_SMALL;
for (region_id = 0; region_id < h->num_rects; region_id++) {
if (buf_size < h->num_rects * 22)
return AVERROR_BUFFER_TOO_SMALL;
for (region_id = 0; region_id < h->num_rects; region_id++) {
/* region composition segment */
/* region composition segment */
if (h->rects[region_id]->nb_colors <= 4) {
/* 2 bpp, some decoders do not support it correctly */
bpp_index = 0;
} else if (h->rects[region_id]->nb_colors <= 16) {
/* 4 bpp, standard encoding */
bpp_index = 1;
} else if (h->rects[region_id]->nb_colors <= 256) {
/* 8 bpp, standard encoding */
bpp_index = 2;
} else {
return AVERROR(EINVAL);
if (h->rects[region_id]->nb_colors <= 4) {
/* 2 bpp, some decoders do not support it correctly */
bpp_index = 0;
} else if (h->rects[region_id]->nb_colors <= 16) {
/* 4 bpp, standard encoding */
bpp_index = 1;
} else if (h->rects[region_id]->nb_colors <= 256) {
/* 8 bpp, standard encoding */
bpp_index = 2;
} else {
return AVERROR(EINVAL);
}
*q++ = 0x0f; /* sync_byte */
*q++ = 0x11; /* segment_type */
bytestream_put_be16(&q, page_id);
pseg_len = q;
q += 2; /* segment length */
*q++ = region_id;
*q++ = (s->object_version << 4) | (0 << 3) | 0x07; /* version , no fill */
bytestream_put_be16(&q, h->rects[region_id]->w); /* region width */
bytestream_put_be16(&q, h->rects[region_id]->h); /* region height */
*q++ = ((1 + bpp_index) << 5) | ((1 + bpp_index) << 2) | 0x03;
*q++ = region_id; /* clut_id == region_id */
*q++ = 0; /* 8 bit fill colors */
*q++ = 0x03; /* 4 bit and 2 bit fill colors */
bytestream_put_be16(&q, region_id); /* object_id == region_id */
*q++ = (0 << 6) | (0 << 4);
*q++ = 0;
*q++ = 0xf0;
*q++ = 0;
bytestream_put_be16(&pseg_len, q - pseg_len - 2);
}
*q++ = 0x0f; /* sync_byte */
*q++ = 0x11; /* segment_type */
bytestream_put_be16(&q, page_id);
pseg_len = q;
q += 2; /* segment length */
*q++ = region_id;
*q++ = (s->object_version << 4) | (0 << 3) | 0x07; /* version , no fill */
bytestream_put_be16(&q, h->rects[region_id]->w); /* region width */
bytestream_put_be16(&q, h->rects[region_id]->h); /* region height */
*q++ = ((1 + bpp_index) << 5) | ((1 + bpp_index) << 2) | 0x03;
*q++ = region_id; /* clut_id == region_id */
*q++ = 0; /* 8 bit fill colors */
*q++ = 0x03; /* 4 bit and 2 bit fill colors */
bytestream_put_be16(&q, region_id); /* object_id == region_id */
*q++ = (0 << 6) | (0 << 4);
*q++ = 0;
*q++ = 0xf0;
*q++ = 0;
bytestream_put_be16(&pseg_len, q - pseg_len - 2);
}
buf_size -= h->num_rects * 22;
buf_size -= h->num_rects * 22;
for (object_id = 0; object_id < h->num_rects; object_id++) {
int (*dvb_encode_rle)(uint8_t **pq, int buf_size,