Mercurial > libavcodec.hg
comparison nuv.c @ 5657:ec46684cc8ad libavcodec
Make sure rtjpeg quality is a valid value
author | reimar |
---|---|
date | Sun, 09 Sep 2007 09:16:47 +0000 |
parents | 3f7d66453c2e |
children | 0dc21d071895 |
comparison
equal
deleted
inserted
replaced
5656:3f7d66453c2e | 5657:ec46684cc8ad |
---|---|
95 /** | 95 /** |
96 * \brief set quantization tables from a quality value | 96 * \brief set quantization tables from a quality value |
97 */ | 97 */ |
98 static void get_quant_quality(NuvContext *c, int quality) { | 98 static void get_quant_quality(NuvContext *c, int quality) { |
99 int i; | 99 int i; |
100 quality = FFMAX(quality, 1); | |
100 for (i = 0; i < 64; i++) { | 101 for (i = 0; i < 64; i++) { |
101 c->lq[i] = (fallback_lquant[i] << 7) / quality; | 102 c->lq[i] = (fallback_lquant[i] << 7) / quality; |
102 c->cq[i] = (fallback_cquant[i] << 7) / quality; | 103 c->cq[i] = (fallback_cquant[i] << 7) / quality; |
103 } | 104 } |
104 } | 105 } |