Originally committed as revision 12311 to svn://svn.ffmpeg.org/ffmpeg/trunktags/v0.5
| @@ -152,6 +152,30 @@ static const uint8_t simple_mmx_permutation[64]={ | |||||
| 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F, | 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F, | ||||
| }; | }; | ||||
| void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable){ | |||||
| int i; | |||||
| int end; | |||||
| st->scantable= src_scantable; | |||||
| for(i=0; i<64; i++){ | |||||
| int j; | |||||
| j = src_scantable[i]; | |||||
| st->permutated[i] = permutation[j]; | |||||
| #ifdef ARCH_POWERPC | |||||
| st->inverse[j] = i; | |||||
| #endif | |||||
| } | |||||
| end=-1; | |||||
| for(i=0; i<64; i++){ | |||||
| int j; | |||||
| j = st->permutated[i]; | |||||
| if(j>end) end=j; | |||||
| st->raster_end[i]= end; | |||||
| } | |||||
| } | |||||
| static int pix_sum_c(uint8_t * pix, int line_size) | static int pix_sum_c(uint8_t * pix, int line_size) | ||||
| { | { | ||||
| int s, i, j; | int s, i, j; | ||||
| @@ -153,6 +153,21 @@ typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align widt | |||||
| // for snow slices | // for snow slices | ||||
| typedef struct slice_buffer_s slice_buffer; | typedef struct slice_buffer_s slice_buffer; | ||||
| /** | |||||
| * Scantable. | |||||
| */ | |||||
| typedef struct ScanTable{ | |||||
| const uint8_t *scantable; | |||||
| uint8_t permutated[64]; | |||||
| uint8_t raster_end[64]; | |||||
| #ifdef ARCH_POWERPC | |||||
| /** Used by dct_quantize_altivec to find last-non-zero */ | |||||
| DECLARE_ALIGNED_8(uint8_t, inverse[64]); | |||||
| #endif | |||||
| } ScanTable; | |||||
| void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable); | |||||
| /** | /** | ||||
| * DSPContext. | * DSPContext. | ||||
| */ | */ | ||||
| @@ -70,29 +70,6 @@ static const uint8_t ff_default_chroma_qscale_table[32]={ | |||||
| 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 | ||||
| }; | }; | ||||
| void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable){ | |||||
| int i; | |||||
| int end; | |||||
| st->scantable= src_scantable; | |||||
| for(i=0; i<64; i++){ | |||||
| int j; | |||||
| j = src_scantable[i]; | |||||
| st->permutated[i] = permutation[j]; | |||||
| #ifdef ARCH_POWERPC | |||||
| st->inverse[j] = i; | |||||
| #endif | |||||
| } | |||||
| end=-1; | |||||
| for(i=0; i<64; i++){ | |||||
| int j; | |||||
| j = st->permutated[i]; | |||||
| if(j>end) end=j; | |||||
| st->raster_end[i]= end; | |||||
| } | |||||
| } | |||||
| const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){ | const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){ | ||||
| int i; | int i; | ||||
| @@ -86,19 +86,6 @@ enum OutputFormat { | |||||
| #define EXT_START_CODE 0x000001b5 | #define EXT_START_CODE 0x000001b5 | ||||
| #define USER_START_CODE 0x000001b2 | #define USER_START_CODE 0x000001b2 | ||||
| /** | |||||
| * Scantable. | |||||
| */ | |||||
| typedef struct ScanTable{ | |||||
| const uint8_t *scantable; | |||||
| uint8_t permutated[64]; | |||||
| uint8_t raster_end[64]; | |||||
| #ifdef ARCH_POWERPC | |||||
| /** Used by dct_quantize_altivec to find last-non-zero */ | |||||
| DECLARE_ALIGNED_8(uint8_t, inverse[64]); | |||||
| #endif | |||||
| } ScanTable; | |||||
| /** | /** | ||||
| * Picture. | * Picture. | ||||
| */ | */ | ||||
| @@ -707,7 +694,6 @@ void MPV_common_init_armv4l(MpegEncContext *s); | |||||
| void MPV_common_init_altivec(MpegEncContext *s); | void MPV_common_init_altivec(MpegEncContext *s); | ||||
| extern void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w); | extern void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w); | ||||
| void ff_clean_intra_table_entries(MpegEncContext *s); | void ff_clean_intra_table_entries(MpegEncContext *s); | ||||
| void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable); | |||||
| void ff_draw_horiz_band(MpegEncContext *s, int y, int h); | void ff_draw_horiz_band(MpegEncContext *s, int y, int h); | ||||
| void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h, | void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h, | ||||
| int src_x, int src_y, int w, int h); | int src_x, int src_y, int w, int h); | ||||