aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2001-08-13 21:48:05 +0000
committerFabrice Bellard <fabrice@bellard.org>2001-08-13 21:48:05 +0000
commit1a56543279a6fd146c8616781b4160e207bb4f6d (patch)
tree4ca37977d896e803a3990e8491f75d02edf49dfd /libavcodec/mpegvideo.c
parentd95ecd058e6256b6deacad8b09fbe58b52f07430 (diff)
downloadffmpeg-1a56543279a6fd146c8616781b4160e207bb4f6d.tar.gz
win32 fixes
Originally committed as revision 84 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index e8cc3ced0b..add0c69121 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -81,7 +81,8 @@ static void convert_matrix(int *qmat, const UINT16 *quant_matrix, int qscale)
/* 16 <= qscale * quant_matrix[i] <= 7905 */
/* 19952 <= aanscales[i] * qscale * quant_matrix[i] <= 249205026 */
- qmat[i] = (int)((1ULL << (QMAT_SHIFT + 11)) / (aanscales[i] * qscale * quant_matrix[i]));
+ qmat[i] = (int)((UINT64_C(1) << (QMAT_SHIFT + 11)) /
+ (aanscales[i] * qscale * quant_matrix[i]));
}
} else {
for(i=0;i<64;i++) {
@@ -983,6 +984,10 @@ static int dct_quantize(MpegEncContext *s,
av_fdct (block);
+ /* we need this permutation so that we correct the IDCT
+ permutation. will be moved into DCT code */
+ block_permute(block);
+
if (s->mb_intra) {
if (n < 4)
q = s->y_dc_scale;
@@ -1251,7 +1256,7 @@ static void rate_control_init(MpegEncContext *s)
*/
static int rate_estimate_qscale(MpegEncContext *s)
{
- long long total_bits = s->total_bits;
+ INT64 total_bits = s->total_bits;
float q;
int qscale, diff, qmin;
@@ -1276,9 +1281,9 @@ static int rate_estimate_qscale(MpegEncContext *s)
q = 31;
qscale = (int)(q + 0.5);
#if defined(DEBUG)
- printf("%d: total=%Ld br=%0.1f diff=%d qest=%0.1f\n",
+ printf("%d: total=%0.0f br=%0.1f diff=%d qest=%0.1f\n",
s->picture_number,
- total_bits,
+ (double)total_bits,
(float)s->frame_rate / FRAME_RATE_BASE *
total_bits / s->picture_number,
diff, q);