summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2015-03-05 13:03:44 +0200
committerXiang, Haihao <haihao.xiang@intel.com>2015-03-09 12:51:30 +0800
commit643124121eb79447d04ca1623a96f69e8408d7cb (patch)
tree755df3b579ee55d2145071f8c6d9b4c760e8ff04
parenta2b1ab1dcc867824f03f4afeb6b10ee419c8efef (diff)
jpeg_enc: Fix the quatisation matrix scaling.
The misplaced parentheses are causing wrong value assignment to the quatization matrix. This will allow the ecoding when quality > 50. Otherwise it will simply generate garbage in encoded video for any quality factor greater than 50 Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com> Reviewed-by: Sirisha Muppavarapu <sirisha.muppavarapu@intel.com> (cherry picked from commit cec62e1f1b1933141bbc190ab095d5ae0955b0b4)
-rw-r--r--src/gen8_mfc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gen8_mfc.c b/src/gen8_mfc.c
index 7b32037..85cad85 100644
--- a/src/gen8_mfc.c
+++ b/src/gen8_mfc.c
@@ -2721,7 +2721,7 @@ gen8_mfc_jpeg_fqm_state(VADriverContextP ctx,
if(qmatrix->load_lum_quantiser_matrix) {
//apply quality to lum_quantiser_matrix
for(i=0; i < 64; i++) {
- temp = qmatrix->lum_quantiser_matrix[i] * (quality/100);
+ temp = (qmatrix->lum_quantiser_matrix[i] * quality)/100;
//clamp to range [1,255]
temp = (temp > 255) ? 255 : temp;
temp = (temp < 1) ? 1 : temp;
@@ -2752,7 +2752,7 @@ gen8_mfc_jpeg_fqm_state(VADriverContextP ctx,
if(qmatrix->load_chroma_quantiser_matrix) {
//apply quality to chroma_quantiser_matrix
for(i=0; i < 64; i++) {
- temp = qmatrix->chroma_quantiser_matrix[i] * (quality/100);
+ temp = (qmatrix->chroma_quantiser_matrix[i] * quality)/100;
//clamp to range [1,255]
temp = (temp > 255) ? 255 : temp;
temp = (temp < 1) ? 1 : temp;