diff options
Diffstat (limited to 'libavcodec/dpxenc.c')
-rw-r--r-- | libavcodec/dpxenc.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c index c731bb4..bde02bc 100644 --- a/libavcodec/dpxenc.c +++ b/libavcodec/dpxenc.c @@ -2,20 +2,20 @@ * DPX (.dpx) image encoder * Copyright (c) 2011 Peter Ross <pross@xvid.org> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -54,6 +54,12 @@ static av_cold int encode_init(AVCodecContext *avctx) case PIX_FMT_RGB48BE: s->bits_per_component = avctx->bits_per_raw_sample ? avctx->bits_per_raw_sample : 16; break; + case PIX_FMT_RGBA64LE: + s->big_endian = 0; + case PIX_FMT_RGBA64BE: + s->descriptor = 51; + s->bits_per_component = 16; + break; default: av_log(avctx, AV_LOG_INFO, "unsupported pixel format\n"); return -1; @@ -74,8 +80,7 @@ do { \ else AV_WL32(p, value); \ } while(0) -static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, - uint8_t *dst) +static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst) { DPXContext *s = avctx->priv_data; const uint8_t *src = pic->data[0]; @@ -126,7 +131,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, memcpy (buf + 8, "V1.0", 4); write32(buf + 20, 1); /* new image */ write32(buf + 24, HEADER_SIZE); - memcpy (buf + 160, LIBAVCODEC_IDENT, FFMIN(sizeof(LIBAVCODEC_IDENT), 100)); + if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ + memcpy (buf + 160, LIBAVCODEC_IDENT, FFMIN(sizeof(LIBAVCODEC_IDENT), 100)); + } write32(buf + 660, 0xFFFFFFFF); /* unencrypted */ /* Image information header */ @@ -144,7 +151,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, write32(buf + 1628, avctx->sample_aspect_ratio.num); write32(buf + 1632, avctx->sample_aspect_ratio.den); - switch (s->bits_per_component) { + switch(s->bits_per_component) { case 8: case 16: size = avpicture_layout((const AVPicture*)frame, avctx->pix_fmt, @@ -183,6 +190,8 @@ AVCodec ff_dpx_encoder = { PIX_FMT_RGBA, PIX_FMT_RGB48LE, PIX_FMT_RGB48BE, + PIX_FMT_RGBA64LE, + PIX_FMT_RGBA64BE, PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("DPX image"), }; |