History

Disable usage of ff_h264_idct_add_altivec since AltiVec versions of h264_idct_add16, h264_idct_add16intra, h264_idct_add8 need to be implemented.

Add C version of ff_h264_idct8_dc_add in AltiVec so that ff_h264_idct8_add_altivec can be used. Originally committed as revision 16311 to svn://svn.ffmpeg.org/ffmpeg/trunk

Guillaume Poirier committed 17 years ago

Commit 337e3fd1 parent 0fa5f241 file · +29 −0Browse files

Unified · Split

libavcodec/ppc/h264_altivec.c+29−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 */
2020
2121 #include "libavcodec/dsputil.h"
22+#include "libavcodec/h264data.h"
2223
2324 #include "gcc_fixes.h"
2425
@@ -595,6 +596,30 @@ void ff_h264_idct8_add_altivec( uint8_t *dst, DCTELEM *dct, int stride ) { · 570 unmodified lines
595596 ALTIVEC_STORE_SUM_CLIP(&dst[7*stride], idct7, perm_ldv, perm_stv, sel);
596597 }
597598
599+// TODO: implement this in AltiVec
600+static void ff_h264_idct8_dc_add_altivec(uint8_t *dst, DCTELEM *block, int stride) {
601+ int i, j;
602+ uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
603+ int dc = (block[0] + 32) >> 6;
604+ for( j = 0; j < 8; j++ )
605+ {
606+ for( i = 0; i < 8; i++ )
607+ dst[i] = cm[ dst[i] + dc ];
608+ dst += stride;
609+ }
610+}
611+
612+static void ff_h264_idct8_add4_altivec(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
613+ int i;
614+ for(i=0; i<16; i+=4){
615+ int nnz = nnzc[ scan8[i] ];
616+ if(nnz){
617+ if(nnz==1 && block[i*16]) ff_h264_idct8_dc_add_altivec(dst + block_offset[i], block + i*16, stride);
618+ else ff_h264_idct8_add_altivec (dst + block_offset[i], block + i*16, stride);
619+ }
620+ }
621+}
622+
598623 #define transpose4x16(r0, r1, r2, r3) { \
599624 register vec_u8_t r4; \
600625 register vec_u8_t r5; \
@@ -874,8 +899,12 @@ void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) { · 273 unmodified lines
874899 c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec;
875900 c->put_no_rnd_h264_chroma_pixels_tab[0] = put_no_rnd_h264_chroma_mc8_altivec;
876901 c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_altivec;
902+/* ff_h264_idct_add_altivec may be re-enabled once AltiVec versions of
903+ h264_idct_add16, h264_idct_add16intra, h264_idct_add8 are implemented
877904 c->h264_idct_add = ff_h264_idct_add_altivec;
905+*/
878906 c->h264_idct8_add = ff_h264_idct8_add_altivec;
907+ c->h264_idct8_add4 = ff_h264_idct8_add4_altivec;
879908 c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_altivec;
880909 c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_altivec;
881910

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t