~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/ppc/mpegvideo_altivec.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
            vec_ste(baseVector, 0, &oldBaseValue);
269
269
 
270
270
            qmat = (vector signed int*)s->q_intra_matrix[qscale];
271
 
            biasAddr = &(s->intra_quant_bias);
 
271
            biasAddr = &s->intra_quant_bias;
272
272
        } else {
273
273
            qmat = (vector signed int*)s->q_inter_matrix[qscale];
274
 
            biasAddr = &(s->inter_quant_bias);
 
274
            biasAddr = &s->inter_quant_bias;
275
275
        }
276
276
 
277
277
        // Load the bias vector (We add 0.5 to the bias so that we're
361
361
            vector signed int max_q_int, min_q_int;
362
362
            vector signed short max_q, min_q;
363
363
 
364
 
            LOAD4(max_q_int, &(s->max_qcoeff));
365
 
            LOAD4(min_q_int, &(s->min_qcoeff));
 
364
            LOAD4(max_q_int, &s->max_qcoeff);
 
365
            LOAD4(min_q_int, &s->min_qcoeff);
366
366
 
367
367
            max_q = vec_pack(max_q_int, max_q_int);
368
368
            min_q = vec_pack(min_q_int, min_q_int);
515
515
        qaddv = vec_splat((vec_s16)vec_lde(0, &qadd8), 0);
516
516
        nqaddv = vec_sub(vczero, qaddv);
517
517
 
518
 
#if 0   // block *is* 16 bytes-aligned, it seems.
519
 
        // first make sure block[j] is 16 bytes-aligned
520
 
        for(j = 0; (j <= nCoeffs) && ((((unsigned long)block) + (j << 1)) & 0x0000000F) ; j++) {
521
 
            level = block[j];
522
 
            if (level) {
523
 
                if (level < 0) {
524
 
                    level = level * qmul - qadd;
525
 
                } else {
526
 
                    level = level * qmul + qadd;
527
 
                }
528
 
                block[j] = level;
529
 
            }
530
 
        }
531
 
#endif
532
 
 
533
518
        // vectorize all the 16 bytes-aligned blocks
534
519
        // of 8 elements
535
520
        for(; (j + 7) <= nCoeffs ; j+=8) {
573
558
{
574
559
    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) return;
575
560
 
576
 
    if (s->avctx->lowres==0) {
577
 
        if ((s->avctx->idct_algo == FF_IDCT_AUTO) ||
578
 
            (s->avctx->idct_algo == FF_IDCT_ALTIVEC)) {
579
 
            s->dsp.idct_put = idct_put_altivec;
580
 
            s->dsp.idct_add = idct_add_altivec;
581
 
            s->dsp.idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
582
 
        }
583
 
    }
584
 
 
585
561
    // Test to make sure that the dct required alignments are met.
586
562
    if ((((long)(s->q_intra_matrix) & 0x0f) != 0) ||
587
563
        (((long)(s->q_inter_matrix) & 0x0f) != 0)) {
599
575
 
600
576
    if ((s->avctx->dct_algo == FF_DCT_AUTO) ||
601
577
            (s->avctx->dct_algo == FF_DCT_ALTIVEC)) {
602
 
#if 0 /* seems to cause trouble under some circumstances */
603
 
        s->dct_quantize = dct_quantize_altivec;
604
 
#endif
605
578
        s->dct_unquantize_h263_intra = dct_unquantize_h263_altivec;
606
579
        s->dct_unquantize_h263_inter = dct_unquantize_h263_altivec;
607
580
    }