summaryrefslogtreecommitdiff
path: root/libavcodec/mjpegenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-12-01 21:33:47 +0100
committerAnton Khirnov <anton@khirnov.net>2013-12-05 13:33:29 +0100
commita1ba1f20b350cb89e645f17bdb237d027170db33 (patch)
tree6aa40337b54e9c61d12b80dd4ca08cf1fb39c5fc /libavcodec/mjpegenc.c
parent0812f5a40a0a190172b6de6e91755b882472ddc5 (diff)
mjpegenc: cosmetics, reformat jpeg_put_comments()
Diffstat (limited to 'libavcodec/mjpegenc.c')
-rw-r--r--libavcodec/mjpegenc.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index a22f34098d..c92be63562 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -153,18 +153,17 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
int size;
uint8_t *ptr;
- if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0)
- {
- /* JFIF header */
- put_marker(p, APP0);
- put_bits(p, 16, 16);
- avpriv_put_string(p, "JFIF", 1); /* this puts the trailing zero-byte too */
- put_bits(p, 16, 0x0201); /* v 1.02 */
- put_bits(p, 8, 0); /* units type: 0 - aspect ratio */
- put_bits(p, 16, avctx->sample_aspect_ratio.num);
- put_bits(p, 16, avctx->sample_aspect_ratio.den);
- put_bits(p, 8, 0); /* thumbnail width */
- put_bits(p, 8, 0); /* thumbnail height */
+ if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) {
+ /* JFIF header */
+ put_marker(p, APP0);
+ put_bits(p, 16, 16);
+ avpriv_put_string(p, "JFIF", 1); /* this puts the trailing zero-byte too */
+ put_bits(p, 16, 0x0201); /* v 1.02 */
+ put_bits(p, 8, 0); /* units type: 0 - aspect ratio */
+ put_bits(p, 16, avctx->sample_aspect_ratio.num);
+ put_bits(p, 16, avctx->sample_aspect_ratio.den);
+ put_bits(p, 8, 0); /* thumbnail width */
+ put_bits(p, 8, 0); /* thumbnail height */
}
/* comment */
@@ -178,9 +177,9 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
AV_WB16(ptr, size);
}
- if( avctx->pix_fmt == AV_PIX_FMT_YUV420P
- ||avctx->pix_fmt == AV_PIX_FMT_YUV422P
- ||avctx->pix_fmt == AV_PIX_FMT_YUV444P){
+ if (avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
+ avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
+ avctx->pix_fmt == AV_PIX_FMT_YUV444P) {
put_marker(p, COM);
flush_put_bits(p);
ptr = put_bits_ptr(p);