[FFmpeg-cvslog] h264: add entries for 11 and 12 bits in ff_h264_chroma_qp[][]

Laurent Aimar git at videolan.org
Sun Oct 2 21:37:22 CEST 2011


ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Sun Oct  2 18:29:30 2011 +0200| [46edabac3c97669d491016903d0f9014692dfcaa] | committer: Michael Niedermayer

h264: add entries for 11 and 12 bits in ff_h264_chroma_qp[][]

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 27d3361e34cf19ad5c0bfb7cfacae0db99b26064)

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

 libavcodec/h264.h    |    4 ++--
 libavcodec/h264_ps.c |   15 ++++++++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 822ba02..5b07f37 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -101,7 +101,7 @@
  */
 #define DELAYED_PIC_REF 4
 
-#define QP_MAX_NUM (51 + 2*6)           // The maximum supported qp
+#define QP_MAX_NUM (51 + 4*6)           // The maximum supported qp
 
 /* NAL unit types */
 enum {
@@ -584,7 +584,7 @@ typedef struct H264Context{
 }H264Context;
 
 
-extern const uint8_t ff_h264_chroma_qp[3][QP_MAX_NUM+1]; ///< One chroma qp table for each supported bit depth (8, 9, 10).
+extern const uint8_t ff_h264_chroma_qp[5][QP_MAX_NUM+1]; ///< One chroma qp table for each possible bit depth (8-12).
 
 /**
  * Decode SEI
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index 4bb02e0..4342c4b 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -70,7 +70,7 @@ static const AVRational pixel_aspect[17]={
     QP(37,d), QP(37,d), QP(37,d), QP(38,d), QP(38,d), QP(38,d),\
     QP(39,d), QP(39,d), QP(39,d), QP(39,d)
 
-const uint8_t ff_h264_chroma_qp[3][QP_MAX_NUM+1] = {
+const uint8_t ff_h264_chroma_qp[5][QP_MAX_NUM+1] = {
     {
         CHROMA_QP_TABLE_END(8)
     },
@@ -83,6 +83,19 @@ const uint8_t ff_h264_chroma_qp[3][QP_MAX_NUM+1] = {
         6, 7, 8, 9, 10, 11,
         CHROMA_QP_TABLE_END(10)
     },
+    {
+        0,  1, 2, 3,  4,  5,
+        6,  7, 8, 9, 10, 11,
+        12,13,14,15, 16, 17,
+        CHROMA_QP_TABLE_END(11)
+    },
+    {
+        0,  1, 2, 3,  4,  5,
+        6,  7, 8, 9, 10, 11,
+        12,13,14,15, 16, 17,
+        18,19,20,21, 22, 23,
+        CHROMA_QP_TABLE_END(12)
+    },
 };
 
 static const uint8_t default_scaling4[2][16]={



More information about the ffmpeg-cvslog mailing list