diff options
author | Clément Bœsch <u@pkh.me> | 2020-08-18 11:32:50 +0300 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2020-08-22 20:02:01 +0300 |
commit | 80d2a33d8389fd636dc5fa502138357dd96175a4 (patch) | |
tree | b3598826ce4e74b3bb341a793d43f94f023cb9c1 /libavcodec | |
parent | 5fc075d53e754c2028a2911138035d1dfedcdb65 (diff) |
avcodec/dvbsubenc: reindent after previous commit
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dvbsubenc.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/libavcodec/dvbsubenc.c b/libavcodec/dvbsubenc.c index ce6de4a774..f6cf1d869f 100644 --- a/libavcodec/dvbsubenc.c +++ b/libavcodec/dvbsubenc.c @@ -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 */ - - 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); - } + /* region composition segment */ - *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; + 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); + } - bytestream_put_be16(&pseg_len, q - pseg_len - 2); - } - buf_size -= h->num_rects * 22; + *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; for (object_id = 0; object_id < h->num_rects; object_id++) { int (*dvb_encode_rle)(uint8_t **pq, int buf_size, |