[FFmpeg-cvslog] img2enc: support 16bit per sample yuv in split planes.

Michael Niedermayer git at videolan.org
Tue Nov 6 02:31:27 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Nov  6 02:27:04 2012 +0100| [2a0dfc51ea9c8e9df2aac56a98512a9dbbcc06cf] | committer: Michael Niedermayer

img2enc: support 16bit per sample yuv in split planes.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a0dfc51ea9c8e9df2aac56a98512a9dbbcc06cf
---

 libavformat/img2enc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index e0d6c99..58236eb 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -100,6 +100,10 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
     if(img->split_planes){
         int ysize = codec->width * codec->height;
         int usize = ((-codec->width)>>desc->log2_chroma_w) * ((-codec->height)>>desc->log2_chroma_h);
+        if (desc->comp[0].depth_minus1 >= 8) {
+            ysize *= 2;
+            usize *= 2;
+        }
         avio_write(pb[0], pkt->data        , ysize);
         avio_write(pb[1], pkt->data + ysize        , usize);
         avio_write(pb[2], pkt->data + ysize + usize, usize);



More information about the ffmpeg-cvslog mailing list