~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/h264pred_template.c

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 */
27
27
 
28
28
#include "mathops.h"
29
 
#include "high_bit_depth.h"
 
29
 
 
30
#include "bit_depth_template.c"
30
31
 
31
32
static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright, int _stride){
32
33
    pixel *src = (pixel*)_src;
120
121
 
121
122
 
122
123
#define LOAD_TOP_RIGHT_EDGE\
123
 
    const int av_unused t4= topright[0];\
124
 
    const int av_unused t5= topright[1];\
125
 
    const int av_unused t6= topright[2];\
126
 
    const int av_unused t7= topright[3];\
 
124
    const unsigned av_unused t4 = topright[0];\
 
125
    const unsigned av_unused t5 = topright[1];\
 
126
    const unsigned av_unused t6 = topright[2];\
 
127
    const unsigned av_unused t7 = topright[3];\
127
128
 
128
129
#define LOAD_DOWN_LEFT_EDGE\
129
 
    const int av_unused l4= src[-1+4*stride];\
130
 
    const int av_unused l5= src[-1+5*stride];\
131
 
    const int av_unused l6= src[-1+6*stride];\
132
 
    const int av_unused l7= src[-1+7*stride];\
 
130
    const unsigned av_unused l4 = src[-1+4*stride];\
 
131
    const unsigned av_unused l5 = src[-1+5*stride];\
 
132
    const unsigned av_unused l6 = src[-1+6*stride];\
 
133
    const unsigned av_unused l7 = src[-1+7*stride];\
133
134
 
134
135
#define LOAD_LEFT_EDGE\
135
 
    const int av_unused l0= src[-1+0*stride];\
136
 
    const int av_unused l1= src[-1+1*stride];\
137
 
    const int av_unused l2= src[-1+2*stride];\
138
 
    const int av_unused l3= src[-1+3*stride];\
 
136
    const unsigned av_unused l0 = src[-1+0*stride];\
 
137
    const unsigned av_unused l1 = src[-1+1*stride];\
 
138
    const unsigned av_unused l2 = src[-1+2*stride];\
 
139
    const unsigned av_unused l3 = src[-1+3*stride];\
139
140
 
140
141
#define LOAD_TOP_EDGE\
141
 
    const int av_unused t0= src[ 0-1*stride];\
142
 
    const int av_unused t1= src[ 1-1*stride];\
143
 
    const int av_unused t2= src[ 2-1*stride];\
144
 
    const int av_unused t3= src[ 3-1*stride];\
 
142
    const unsigned av_unused t0 = src[ 0-1*stride];\
 
143
    const unsigned av_unused t1 = src[ 1-1*stride];\
 
144
    const unsigned av_unused t2 = src[ 2-1*stride];\
 
145
    const unsigned av_unused t3 = src[ 3-1*stride];\
145
146
 
146
147
static void FUNCC(pred4x4_down_right)(uint8_t *_src, const uint8_t *topright, int _stride){
147
148
    pixel *src = (pixel*)_src;
387
388
    PREDICT_16x16_DC(PIXEL_SPLAT_X4(v));\
388
389
}
389
390
 
390
 
PRED16x16_X(127, (1<<(BIT_DEPTH-1))-1);
391
 
PRED16x16_X(128, (1<<(BIT_DEPTH-1))+0);
392
 
PRED16x16_X(129, (1<<(BIT_DEPTH-1))+1);
 
391
PRED16x16_X(127, (1<<(BIT_DEPTH-1))-1)
 
392
PRED16x16_X(128, (1<<(BIT_DEPTH-1))+0)
 
393
PRED16x16_X(129, (1<<(BIT_DEPTH-1))+1)
393
394
 
394
395
static inline void FUNCC(pred16x16_plane_compat)(uint8_t *_src, int _stride, const int svq3, const int rv40){
395
396
  int i, j, k;
453
454
    }
454
455
}
455
456
 
 
457
static void FUNCC(pred8x16_vertical)(uint8_t *_src, int _stride){
 
458
    int i;
 
459
    pixel *src = (pixel*)_src;
 
460
    int stride = _stride>>(sizeof(pixel)-1);
 
461
    const pixel4 a= AV_RN4PA(((pixel4*)(src-stride))+0);
 
462
    const pixel4 b= AV_RN4PA(((pixel4*)(src-stride))+1);
 
463
 
 
464
    for(i=0; i<16; i++){
 
465
        AV_WN4PA(((pixel4*)(src+i*stride))+0, a);
 
466
        AV_WN4PA(((pixel4*)(src+i*stride))+1, b);
 
467
    }
 
468
}
 
469
 
456
470
static void FUNCC(pred8x8_horizontal)(uint8_t *_src, int stride){
457
471
    int i;
458
472
    pixel *src = (pixel*)_src;
465
479
    }
466
480
}
467
481
 
 
482
static void FUNCC(pred8x16_horizontal)(uint8_t *_src, int stride){
 
483
    int i;
 
484
    pixel *src = (pixel*)_src;
 
485
    stride >>= sizeof(pixel)-1;
 
486
    for(i=0; i<16; i++){
 
487
        const pixel4 a = PIXEL_SPLAT_X4(src[-1+i*stride]);
 
488
        AV_WN4PA(((pixel4*)(src+i*stride))+0, a);
 
489
        AV_WN4PA(((pixel4*)(src+i*stride))+1, a);
 
490
    }
 
491
}
 
492
 
468
493
#define PRED8x8_X(n, v)\
469
494
static void FUNCC(pred8x8_##n##_dc)(uint8_t *_src, int stride){\
470
495
    int i;\
477
502
    }\
478
503
}
479
504
 
480
 
PRED8x8_X(127, (1<<(BIT_DEPTH-1))-1);
481
 
PRED8x8_X(128, (1<<(BIT_DEPTH-1))+0);
482
 
PRED8x8_X(129, (1<<(BIT_DEPTH-1))+1);
 
505
PRED8x8_X(127, (1<<(BIT_DEPTH-1))-1)
 
506
PRED8x8_X(128, (1<<(BIT_DEPTH-1))+0)
 
507
PRED8x8_X(129, (1<<(BIT_DEPTH-1))+1)
 
508
 
 
509
static void FUNCC(pred8x16_128_dc)(uint8_t *_src, int stride){
 
510
    FUNCC(pred8x8_128_dc)(_src, stride);
 
511
    FUNCC(pred8x8_128_dc)(_src+8*stride, stride);
 
512
}
483
513
 
484
514
static void FUNCC(pred8x8_left_dc)(uint8_t *_src, int stride){
485
515
    int i;
506
536
    }
507
537
}
508
538
 
 
539
static void FUNCC(pred8x16_left_dc)(uint8_t *_src, int stride){
 
540
    FUNCC(pred8x8_left_dc)(_src, stride);
 
541
    FUNCC(pred8x8_left_dc)(_src+8*stride, stride);
 
542
}
 
543
 
509
544
static void FUNCC(pred8x8_top_dc)(uint8_t *_src, int stride){
510
545
    int i;
511
546
    int dc0, dc1;
531
566
    }
532
567
}
533
568
 
 
569
static void FUNCC(pred8x16_top_dc)(uint8_t *_src, int stride){
 
570
    int i;
 
571
    int dc0, dc1;
 
572
    pixel4 dc0splat, dc1splat;
 
573
    pixel *src = (pixel*)_src;
 
574
    stride >>= sizeof(pixel)-1;
 
575
 
 
576
    dc0=dc1=0;
 
577
    for(i=0;i<4; i++){
 
578
        dc0+= src[i-stride];
 
579
        dc1+= src[4+i-stride];
 
580
    }
 
581
    dc0splat = PIXEL_SPLAT_X4((dc0 + 2)>>2);
 
582
    dc1splat = PIXEL_SPLAT_X4((dc1 + 2)>>2);
 
583
 
 
584
    for(i=0; i<16; i++){
 
585
        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc0splat);
 
586
        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc1splat);
 
587
    }
 
588
}
 
589
 
534
590
static void FUNCC(pred8x8_dc)(uint8_t *_src, int stride){
535
591
    int i;
536
592
    int dc0, dc1, dc2;
559
615
    }
560
616
}
561
617
 
562
 
//the following 4 function should not be optimized!
 
618
static void FUNCC(pred8x16_dc)(uint8_t *_src, int stride){
 
619
    int i;
 
620
    int dc0, dc1, dc2, dc3, dc4;
 
621
    pixel4 dc0splat, dc1splat, dc2splat, dc3splat, dc4splat, dc5splat, dc6splat, dc7splat;
 
622
    pixel *src = (pixel*)_src;
 
623
    stride >>= sizeof(pixel)-1;
 
624
 
 
625
    dc0=dc1=dc2=dc3=dc4=0;
 
626
    for(i=0;i<4; i++){
 
627
        dc0+= src[-1+i*stride] + src[i-stride];
 
628
        dc1+= src[4+i-stride];
 
629
        dc2+= src[-1+(i+4)*stride];
 
630
        dc3+= src[-1+(i+8)*stride];
 
631
        dc4+= src[-1+(i+12)*stride];
 
632
    }
 
633
    dc0splat = PIXEL_SPLAT_X4((dc0 + 4)>>3);
 
634
    dc1splat = PIXEL_SPLAT_X4((dc1 + 2)>>2);
 
635
    dc2splat = PIXEL_SPLAT_X4((dc2 + 2)>>2);
 
636
    dc3splat = PIXEL_SPLAT_X4((dc1 + dc2 + 4)>>3);
 
637
    dc4splat = PIXEL_SPLAT_X4((dc3 + 2)>>2);
 
638
    dc5splat = PIXEL_SPLAT_X4((dc1 + dc3 + 4)>>3);
 
639
    dc6splat = PIXEL_SPLAT_X4((dc4 + 2)>>2);
 
640
    dc7splat = PIXEL_SPLAT_X4((dc1 + dc4 + 4)>>3);
 
641
 
 
642
    for(i=0; i<4; i++){
 
643
        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc0splat);
 
644
        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc1splat);
 
645
    }
 
646
    for(i=4; i<8; i++){
 
647
        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc2splat);
 
648
        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc3splat);
 
649
    }
 
650
    for(i=8; i<12; i++){
 
651
        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc4splat);
 
652
        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc5splat);
 
653
    }
 
654
    for(i=12; i<16; i++){
 
655
        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc6splat);
 
656
        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc7splat);
 
657
    }
 
658
}
 
659
 
563
660
static void FUNC(pred8x8_mad_cow_dc_l0t)(uint8_t *src, int stride){
564
661
    FUNCC(pred8x8_top_dc)(src, stride);
565
662
    FUNCC(pred4x4_dc)(src, NULL, stride);
566
663
}
567
664
 
 
665
static void FUNC(pred8x16_mad_cow_dc_l0t)(uint8_t *src, int stride){
 
666
    FUNCC(pred8x16_top_dc)(src, stride);
 
667
    FUNCC(pred4x4_dc)(src, NULL, stride);
 
668
}
 
669
 
568
670
static void FUNC(pred8x8_mad_cow_dc_0lt)(uint8_t *src, int stride){
569
671
    FUNCC(pred8x8_dc)(src, stride);
570
672
    FUNCC(pred4x4_top_dc)(src, NULL, stride);
571
673
}
572
674
 
 
675
static void FUNC(pred8x16_mad_cow_dc_0lt)(uint8_t *src, int stride){
 
676
    FUNCC(pred8x16_dc)(src, stride);
 
677
    FUNCC(pred4x4_top_dc)(src, NULL, stride);
 
678
}
 
679
 
573
680
static void FUNC(pred8x8_mad_cow_dc_l00)(uint8_t *src, int stride){
574
681
    FUNCC(pred8x8_left_dc)(src, stride);
575
682
    FUNCC(pred4x4_128_dc)(src + 4*stride                  , NULL, stride);
576
683
    FUNCC(pred4x4_128_dc)(src + 4*stride + 4*sizeof(pixel), NULL, stride);
577
684
}
578
685
 
 
686
static void FUNC(pred8x16_mad_cow_dc_l00)(uint8_t *src, int stride){
 
687
    FUNCC(pred8x16_left_dc)(src, stride);
 
688
    FUNCC(pred4x4_128_dc)(src + 4*stride                  , NULL, stride);
 
689
    FUNCC(pred4x4_128_dc)(src + 4*stride + 4*sizeof(pixel), NULL, stride);
 
690
}
 
691
 
579
692
static void FUNC(pred8x8_mad_cow_dc_0l0)(uint8_t *src, int stride){
580
693
    FUNCC(pred8x8_left_dc)(src, stride);
581
694
    FUNCC(pred4x4_128_dc)(src                  , NULL, stride);
582
695
    FUNCC(pred4x4_128_dc)(src + 4*sizeof(pixel), NULL, stride);
583
696
}
584
697
 
 
698
static void FUNC(pred8x16_mad_cow_dc_0l0)(uint8_t *src, int stride){
 
699
    FUNCC(pred8x16_left_dc)(src, stride);
 
700
    FUNCC(pred4x4_128_dc)(src                  , NULL, stride);
 
701
    FUNCC(pred4x4_128_dc)(src + 4*sizeof(pixel), NULL, stride);
 
702
}
 
703
 
585
704
static void FUNCC(pred8x8_plane)(uint8_t *_src, int _stride){
586
705
  int j, k;
587
706
  int a;
617
736
  }
618
737
}
619
738
 
 
739
static void FUNCC(pred8x16_plane)(uint8_t *_src, int _stride){
 
740
  int j, k;
 
741
  int a;
 
742
  INIT_CLIP
 
743
  pixel *src = (pixel*)_src;
 
744
  int stride = _stride>>(sizeof(pixel)-1);
 
745
  const pixel * const src0 = src +3-stride;
 
746
  const pixel *       src1 = src +8*stride-1;
 
747
  const pixel *       src2 = src1-2*stride;    // == src+6*stride-1;
 
748
  int H = src0[1] - src0[-1];
 
749
  int V = src1[0] - src2[ 0];
 
750
 
 
751
  for (k = 2; k <= 4; ++k) {
 
752
      src1 += stride; src2 -= stride;
 
753
      H += k*(src0[k] - src0[-k]);
 
754
      V += k*(src1[0] - src2[ 0]);
 
755
  }
 
756
  for (; k <= 8; ++k) {
 
757
      src1 += stride; src2 -= stride;
 
758
      V += k*(src1[0] - src2[0]);
 
759
  }
 
760
 
 
761
  H = (17*H+16) >> 5;
 
762
  V = (5*V+32) >> 6;
 
763
 
 
764
  a = 16*(src1[0] + src2[8] + 1) - 7*V - 3*H;
 
765
  for(j=16; j>0; --j) {
 
766
    int b = a;
 
767
    a += V;
 
768
    src[0] = CLIP((b    ) >> 5);
 
769
    src[1] = CLIP((b+  H) >> 5);
 
770
    src[2] = CLIP((b+2*H) >> 5);
 
771
    src[3] = CLIP((b+3*H) >> 5);
 
772
    src[4] = CLIP((b+4*H) >> 5);
 
773
    src[5] = CLIP((b+5*H) >> 5);
 
774
    src[6] = CLIP((b+6*H) >> 5);
 
775
    src[7] = CLIP((b+7*H) >> 5);
 
776
    src += stride;
 
777
  }
 
778
}
 
779
 
620
780
#define SRC(x,y) src[(x)+(y)*stride]
621
781
#define PL(y) \
622
782
    const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
987
1147
        FUNCC(pred4x4_vertical_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
988
1148
}
989
1149
 
 
1150
static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride){
 
1151
    int i;
 
1152
    for(i=0; i<4; i++)
 
1153
        FUNCC(pred4x4_vertical_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
 
1154
    for(i=4; i<8; i++)
 
1155
        FUNCC(pred4x4_vertical_add)(pix + block_offset[i+4], block + i*16*sizeof(pixel), stride);
 
1156
}
 
1157
 
990
1158
static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride){
991
1159
    int i;
992
1160
    for(i=0; i<4; i++)
993
1161
        FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
994
1162
}
 
1163
 
 
1164
static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride){
 
1165
    int i;
 
1166
    for(i=0; i<4; i++)
 
1167
        FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
 
1168
    for(i=4; i<8; i++)
 
1169
        FUNCC(pred4x4_horizontal_add)(pix + block_offset[i+4], block + i*16*sizeof(pixel), stride);
 
1170
}