diff options
Diffstat (limited to 'src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c')
-rw-r--r-- | src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c b/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c index 91e744af9..7a771a8ec 100644 --- a/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c +++ b/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <stdlib.h> @@ -25,7 +25,7 @@ #include "../mpegvideo.h" #include "gcc_fixes.h" - + #include "dsputil_altivec.h" // Swaps two variables (used for altivec registers) @@ -103,7 +103,7 @@ do { \ // slower, for dumb non-apple GCC #define FOUROF(a) {a,a,a,a} #endif -int dct_quantize_altivec(MpegEncContext* s, +int dct_quantize_altivec(MpegEncContext* s, DCTELEM* data, int n, int qscale, int* overflow) { @@ -152,9 +152,9 @@ int dct_quantize_altivec(MpegEncContext* s, } // The following block could exist as a separate an altivec dct - // function. However, if we put it inline, the DCT data can remain - // in the vector local variables, as floats, which we'll use during the - // quantize step... + // function. However, if we put it inline, the DCT data can remain + // in the vector local variables, as floats, which we'll use during the + // quantize step... { const vector float vec_0_298631336 = (vector float)FOUROF(0.298631336f); const vector float vec_0_390180644 = (vector float)FOUROF(-0.390180644f); @@ -206,11 +206,11 @@ int dct_quantize_altivec(MpegEncContext* s, z1 = vec_madd(vec_add(tmp12, tmp13), vec_0_541196100, (vector float)zero); // dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), - // CONST_BITS-PASS1_BITS); + // CONST_BITS-PASS1_BITS); row2 = vec_madd(tmp13, vec_0_765366865, z1); // dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), - // CONST_BITS-PASS1_BITS); + // CONST_BITS-PASS1_BITS); row6 = vec_madd(tmp12, vec_1_847759065, z1); z1 = vec_add(tmp4, tmp7); // z1 = tmp4 + tmp7; @@ -273,7 +273,7 @@ int dct_quantize_altivec(MpegEncContext* s, if (whichPass == 1) { // transpose the data for the second pass - + // First, block transpose the upper right with lower left. SWAP(row4, alt0); SWAP(row5, alt1); @@ -315,7 +315,7 @@ int dct_quantize_altivec(MpegEncContext* s, } // Load the bias vector (We add 0.5 to the bias so that we're - // rounding when we convert to int, instead of flooring.) + // rounding when we convert to int, instead of flooring.) { vector signed int biasInt; const vector float negOneFloat = (vector float)FOUROF(-1.0f); @@ -380,7 +380,7 @@ int dct_quantize_altivec(MpegEncContext* s, vec_cmpgt(alt7, zero)); } - + } // Store the data back into the original block @@ -469,7 +469,7 @@ int dct_quantize_altivec(MpegEncContext* s, vec_ste(scanIndices_01, 0, &lastNonZeroChar); lastNonZero = lastNonZeroChar; - + // While the data is still in vectors we check for the transpose IDCT permute // and handle it using the vector unit if we can. This is the permute used // by the altivec idct, so it is common when using the altivec dct. @@ -523,30 +523,30 @@ int dct_quantize_altivec(MpegEncContext* s, AltiVec version of dct_unquantize_h263 this code assumes `block' is 16 bytes-aligned */ -void dct_unquantize_h263_altivec(MpegEncContext *s, +void dct_unquantize_h263_altivec(MpegEncContext *s, DCTELEM *block, int n, int qscale) { POWERPC_PERF_DECLARE(altivec_dct_unquantize_h263_num, 1); int i, level, qmul, qadd; int nCoeffs; - + assert(s->block_last_index[n]>=0); POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1); - + qadd = (qscale - 1) | 1; qmul = qscale << 1; - + if (s->mb_intra) { if (!s->h263_aic) { - if (n < 4) + if (n < 4) block[0] = block[0] * s->y_dc_scale; else block[0] = block[0] * s->c_dc_scale; }else qadd = 0; i = 1; - nCoeffs= 63; //does not allways use zigzag table + nCoeffs= 63; //does not allways use zigzag table } else { i = 0; nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]; @@ -586,7 +586,7 @@ POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1); register vector bool short blockv_null, blockv_neg; register short backup_0 = block[0]; register int j = 0; - + qmulv = vec_ld(0, qmul8); qaddv = vec_ld(0, qadd8); nqaddv = vec_ld(0, nqadd8); @@ -605,7 +605,7 @@ POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1); } } #endif - + // vectorize all the 16 bytes-aligned blocks // of 8 elements for(; (j + 7) <= nCoeffs ; j+=8) @@ -637,7 +637,7 @@ POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1); block[j] = level; } } - + if (i == 1) { // cheat. this avoid special-casing the first iteration block[0] = backup_0; |