diff h264.c @ 7347:612a78c3b128 libavcodec

qscale has a range of 0..51 we thus do not need a 256 entry table and neither need to and it with 0xFF.
author michael
date Tue, 22 Jul 2008 13:01:10 +0000
parents def19f6f7ce9
children 39e5cadcebab
line wrap: on
line diff
--- a/h264.c	Tue Jul 22 12:31:48 2008 +0000
+++ b/h264.c	Tue Jul 22 13:01:10 2008 +0000
@@ -1584,7 +1584,7 @@
  * gets the chroma qp.
  */
 static inline int get_chroma_qp(H264Context *h, int t, int qscale){
-    return h->pps.chroma_qp_table[t][qscale & 0xff];
+    return h->pps.chroma_qp_table[t][qscale];
 }
 
 //FIXME need to check that this does not overflow signed 32 bit for low qp, I am not sure, it's very close
@@ -7337,8 +7337,8 @@
 build_qp_table(PPS *pps, int t, int index)
 {
     int i;
-    for(i = 0; i < 255; i++)
-        pps->chroma_qp_table[t][i & 0xff] = chroma_qp[av_clip(i + index, 0, 51)];
+    for(i = 0; i < 52; i++)
+        pps->chroma_qp_table[t][i] = chroma_qp[av_clip(i + index, 0, 51)];
 }
 
 static inline int decode_picture_parameter_set(H264Context *h, int bit_length){