comparison libvo/jpeg_enc.c @ 7902:c9d1054aa359

sync with libavcodec for unaccellerated dcts (sorry Felix, LIBAVCODEC_BUILD did not change, so also no backwards compatibility this time), and a long overdue copyright update
author rik
date Thu, 24 Oct 2002 21:27:50 +0000
parents 85e9956a6727
children dda027d5a845
comparison
equal deleted inserted replaced
7901:80e1aa85bac4 7902:c9d1054aa359
1 /* Straightforward (to be) optimized JPEG encoder for the YUV422 format 1 /* Straightforward (to be) optimized JPEG encoder for the YUV422 format
2 * based on mjpeg code from ffmpeg. 2 * based on mjpeg code from ffmpeg.
3 * 3 *
4 * Copyright (c) 2002, Rik Snel 4 * Copyright (c) 2002, Rik Snel
5 * Parts from ffmpeg Copyright (c) 2000, 2001 Gerard Lantau 5 * Parts from ffmpeg Copyright (c) 2000-2002 Fabrice Bellard
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or 9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version. 10 * (at your option) any later version.
89 * qscale * quant_matrix[i] <= 205026 89 * qscale * quant_matrix[i] <= 205026
90 * (1<<36)/19952 >= (1<<36)/(aanscales[i] * \ 90 * (1<<36)/19952 >= (1<<36)/(aanscales[i] * \
91 * qscale * quant_matrix[i]) >= (1<<36)/249205025 91 * qscale * quant_matrix[i]) >= (1<<36)/249205025
92 * 3444240 >= (1<<36)/(aanscales[i] * 92 * 3444240 >= (1<<36)/(aanscales[i] *
93 * qscale * quant_matrix[i]) >= 275 */ 93 * qscale * quant_matrix[i]) >= 275 */
94 qmat[qscale][j] = (int)((UINT64_C(1) << (QMAT_SHIFT-3))/ 94 qmat[qscale][i] = (int)((UINT64_C(1) << (QMAT_SHIFT-3))/
95 (qscale * quant_matrix[j])); 95 (qscale * quant_matrix[j]));
96 } 96 }
97 } else if (s->fdct == fdct_ifast) { 97 } else if (s->fdct == fdct_ifast) {
98 for(i=0;i<64;i++) { 98 for(i=0;i<64;i++) {
99 const int j = s->idct_permutation[i]; 99 const int j = s->idct_permutation[i];
100 /* 16 <= qscale * quant_matrix[i] <= 7905 */ 100 /* 16 <= qscale * quant_matrix[i] <= 7905 */
101 /* 19952 <= aanscales[i] * qscale * quant_matrix[i] <= 249205026 */ 101 /* 19952 <= aanscales[i] * qscale * quant_matrix[i] <= 249205026 */
102 /* (1<<36)/19952 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= (1<<36)/249205026 */ 102 /* (1<<36)/19952 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= (1<<36)/249205026 */
103 /* 3444240 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= 275 */ 103 /* 3444240 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= 275 */
104 104
105 qmat[qscale][j] = (int)((UINT64_C(1) << (QMAT_SHIFT + 11)) / 105 qmat[qscale][i] = (int)((UINT64_C(1) << (QMAT_SHIFT + 11)) /
106 (aanscales[i] * qscale * quant_matrix[j])); 106 (aanscales[i] * qscale * quant_matrix[j]));
107 } 107 }
108 } else { 108 } else {
109 for(i=0;i<64;i++) { 109 for(i=0;i<64;i++) {
110 const int j = s->idct_permutation[i]; 110 const int j = s->idct_permutation[i];