Skip to content

Commit

Permalink
Use xine_fast_memcpy.
Browse files Browse the repository at this point in the history
  • Loading branch information
huceke committed Sep 5, 2010
1 parent d2492bf commit 8e16730
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion crystalhd_decoder.c
Expand Up @@ -160,7 +160,7 @@ static void crystalhd_video_render (crystalhd_video_decoder_t *this, image_buffe
}
}

static void* crystalhd_video_rec_thread (void *this_gen) {
void* crystalhd_video_rec_thread (void *this_gen) {
crystalhd_video_decoder_t *this = (crystalhd_video_decoder_t *) this_gen;

BC_STATUS ret = BC_STS_ERROR;
Expand Down
1 change: 1 addition & 0 deletions crystalhd_decoder.h
Expand Up @@ -227,6 +227,7 @@ typedef struct crystalhd_video_decoder_s {
typedef uint32_t BCM_STREAM_TYPE;
typedef uint32_t BCM_VIDEO_ALGO;

void *crystalhd_video_rec_thread (void *this_gen);
void crystalhd_decode_package (uint8_t *buf, uint32_t size);
void set_video_params (crystalhd_video_decoder_t *this);

Expand Down
2 changes: 1 addition & 1 deletion crystalhd_mpeg.c
Expand Up @@ -416,7 +416,7 @@ void mpeg_decode_picture( crystalhd_video_decoder_t *this, uint8_t end_of_sequen

lprintf("crystalhd_mpeg: slice buf len %ld\n", len);

memcpy(buf, pic->slices, len);
xine_fast_memcpy(buf, pic->slices, len);

#define FILEDEBUG 1
#ifdef FILEDEBUG
Expand Down
14 changes: 7 additions & 7 deletions crystalhd_vc1.c
Expand Up @@ -134,7 +134,7 @@ void crystalhd_vc1_handle_buffer (crystalhd_video_decoder_t *this,
if ((bytestream[0] == 0x00) && (bytestream[1] == 0x00) && (bytestream[2] == 0x01)) {

if(sequence->bytestream_bytes) {
memcpy(p, sequence->bytestream, sequence->bytestream_bytes);
xine_fast_memcpy(p, sequence->bytestream, sequence->bytestream_bytes);
p+=sequence->bytestream_bytes;
}

Expand Down Expand Up @@ -178,7 +178,7 @@ void crystalhd_vc1_handle_buffer (crystalhd_video_decoder_t *this,
}
}

memcpy(p, bytestream, bytestream_bytes);
xine_fast_memcpy(p, bytestream, bytestream_bytes);
//crystalhd_decode_package(buf, 20);

if(this->set_form) {
Expand Down Expand Up @@ -450,7 +450,7 @@ void parse_header( crystalhd_video_decoder_t *this, uint8_t *buf, int len )
free(sequence->bytestream);
sequence->bytestream_bytes = len-off;
sequence->bytestream = realloc( sequence->bytestream, sequence->bytestream_bytes );
memcpy(sequence->bytestream, buf+off, sequence->bytestream_bytes);
xine_fast_memcpy(sequence->bytestream, buf+off, sequence->bytestream_bytes);

break;
}
Expand All @@ -462,7 +462,7 @@ void parse_header( crystalhd_video_decoder_t *this, uint8_t *buf, int len )
free(sequence->bytestream);
sequence->bytestream_bytes = len;
sequence->bytestream = realloc( sequence->bytestream, sequence->bytestream_bytes );
memcpy(sequence->bytestream, buf, sequence->bytestream_bytes);
xine_fast_memcpy(sequence->bytestream, buf, sequence->bytestream_bytes);

sequence_header( this, buf, len );
}
Expand All @@ -483,7 +483,7 @@ void remove_emulation_prevention( uint8_t *src, uint8_t *dst, int src_len, int *
++removed;
}
else {
memcpy( dst+len, src+i, 4 );
xine_fast_memcpy( dst+len, src+i, 4 );
++len;
}
}
Expand Down Expand Up @@ -520,7 +520,7 @@ int parse_code( crystalhd_video_decoder_t *this, uint8_t *buf, int len )
free(sequence->bytestream);
sequence->bytestream_bytes = dst_len;
sequence->bytestream = realloc( sequence->bytestream, sequence->bytestream_bytes );
memcpy(sequence->bytestream, tmp, sequence->bytestream_bytes);
xine_fast_memcpy(sequence->bytestream, tmp, sequence->bytestream_bytes);

free( tmp );
break;
Expand All @@ -532,7 +532,7 @@ int parse_code( crystalhd_video_decoder_t *this, uint8_t *buf, int len )

sequence->bytestream_bytes += dst_len;
sequence->bytestream = realloc( sequence->bytestream, sequence->bytestream_bytes);
memcpy(sequence->bytestream + ( sequence->bytestream_bytes - dst_len), tmp, dst_len);
xine_fast_memcpy(sequence->bytestream + ( sequence->bytestream_bytes - dst_len), tmp, dst_len);

free( tmp );
break;
Expand Down
30 changes: 15 additions & 15 deletions h264_parser.c
Expand Up @@ -135,7 +135,7 @@ static void decode_nal(uint8_t **ret, int *len_ret, uint8_t *buf, int buf_len)
static inline void dump_bits(const char *label, const struct buf_reader *buf, int bits)
{
struct buf_reader lbuf;
memcpy(&lbuf, buf, sizeof(struct buf_reader));
xine_fast_memcpy(&lbuf, buf, sizeof(struct buf_reader));

int i;
printf("%s: 0b", label);
Expand Down Expand Up @@ -448,7 +448,7 @@ void parse_scaling_list(struct buf_reader *buf, uint8_t *scaling_list,
for(i = 0; i < sizeof(default_4x4_intra); i++) {
scaling_list[zigzag_4x4[i]] = default_4x4_intra[i];
}
//memcpy(scaling_list, default_4x4_intra, sizeof(default_4x4_intra));
//xine_fast_memcpy(scaling_list, default_4x4_intra, sizeof(default_4x4_intra));
break;
}
case 3:
Expand All @@ -457,21 +457,21 @@ void parse_scaling_list(struct buf_reader *buf, uint8_t *scaling_list,
for(i = 0; i < sizeof(default_4x4_inter); i++) {
scaling_list[zigzag_4x4[i]] = default_4x4_inter[i];
}
//memcpy(scaling_list, default_4x4_inter, sizeof(default_4x4_inter));
//xine_fast_memcpy(scaling_list, default_4x4_inter, sizeof(default_4x4_inter));
break;
}
case 6: {
for(i = 0; i < sizeof(default_8x8_intra); i++) {
scaling_list[zigzag_8x8[i]] = default_8x8_intra[i];
}
//memcpy(scaling_list, default_8x8_intra, sizeof(default_8x8_intra));
//xine_fast_memcpy(scaling_list, default_8x8_intra, sizeof(default_8x8_intra));
break;
}
case 7: {
for(i = 0; i < sizeof(default_8x8_inter); i++) {
scaling_list[zigzag_8x8[i]] = default_8x8_inter[i];
}
//memcpy(scaling_list, default_8x8_inter, sizeof(default_8x8_inter));
//xine_fast_memcpy(scaling_list, default_8x8_inter, sizeof(default_8x8_inter));
break;
}
}
Expand All @@ -486,34 +486,34 @@ static void sps_scaling_list_fallback(struct seq_parameter_set_rbsp *sps, int i)
for(j = 0; j < sizeof(default_4x4_intra); j++) {
sps->scaling_lists_4x4[i][zigzag_4x4[j]] = default_4x4_intra[j];
}
//memcpy(sps->scaling_lists_4x4[i], default_4x4_intra, sizeof(sps->scaling_lists_4x4[i]));
//xine_fast_memcpy(sps->scaling_lists_4x4[i], default_4x4_intra, sizeof(sps->scaling_lists_4x4[i]));
break;
}
case 3: {
for(j = 0; j < sizeof(default_4x4_inter); j++) {
sps->scaling_lists_4x4[i][zigzag_4x4[j]] = default_4x4_inter[j];
}
//memcpy(sps->scaling_lists_4x4[i], default_4x4_inter, sizeof(sps->scaling_lists_4x4[i]));
//xine_fast_memcpy(sps->scaling_lists_4x4[i], default_4x4_inter, sizeof(sps->scaling_lists_4x4[i]));
break;
}
case 1:
case 2:
case 4:
case 5:
memcpy(sps->scaling_lists_4x4[i], sps->scaling_lists_4x4[i-1], sizeof(sps->scaling_lists_4x4[i]));
xine_fast_memcpy(sps->scaling_lists_4x4[i], sps->scaling_lists_4x4[i-1], sizeof(sps->scaling_lists_4x4[i]));
break;
case 6: {
for(j = 0; j < sizeof(default_8x8_intra); j++) {
sps->scaling_lists_8x8[i-6][zigzag_8x8[j]] = default_8x8_intra[j];
}
//memcpy(sps->scaling_lists_8x8[i-6], default_8x8_intra, sizeof(sps->scaling_lists_8x8[i-6]));
//xine_fast_memcpy(sps->scaling_lists_8x8[i-6], default_8x8_intra, sizeof(sps->scaling_lists_8x8[i-6]));
break;
}
case 7: {
for(j = 0; j < sizeof(default_8x8_inter); j++) {
sps->scaling_lists_8x8[i-6][zigzag_8x8[j]] = default_8x8_inter[j];
}
//memcpy(sps->scaling_lists_8x8[i-6], default_8x8_inter, sizeof(sps->scaling_lists_8x8[i-6]));
//xine_fast_memcpy(sps->scaling_lists_8x8[i-6], default_8x8_inter, sizeof(sps->scaling_lists_8x8[i-6]));
break;
}

Expand All @@ -525,17 +525,17 @@ static void pps_scaling_list_fallback(struct seq_parameter_set_rbsp *sps, struct
switch (i) {
case 0:
case 3:
memcpy(pps->scaling_lists_4x4[i], sps->scaling_lists_4x4[i], sizeof(pps->scaling_lists_4x4[i]));
xine_fast_memcpy(pps->scaling_lists_4x4[i], sps->scaling_lists_4x4[i], sizeof(pps->scaling_lists_4x4[i]));
break;
case 1:
case 2:
case 4:
case 5:
memcpy(pps->scaling_lists_4x4[i], pps->scaling_lists_4x4[i-1], sizeof(pps->scaling_lists_4x4[i]));
xine_fast_memcpy(pps->scaling_lists_4x4[i], pps->scaling_lists_4x4[i-1], sizeof(pps->scaling_lists_4x4[i]));
break;
case 6:
case 7:
memcpy(pps->scaling_lists_8x8[i-6], sps->scaling_lists_8x8[i-6], sizeof(pps->scaling_lists_8x8[i-6]));
xine_fast_memcpy(pps->scaling_lists_8x8[i-6], sps->scaling_lists_8x8[i-6], sizeof(pps->scaling_lists_8x8[i-6]));
break;

}
Expand Down Expand Up @@ -1003,9 +1003,9 @@ void interpret_pps(struct coded_picture *pic)
}

if (!pps->pic_scaling_matrix_present_flag && sps != NULL) {
memcpy(pps->scaling_lists_4x4, sps->scaling_lists_4x4,
xine_fast_memcpy(pps->scaling_lists_4x4, sps->scaling_lists_4x4,
sizeof(pps->scaling_lists_4x4));
memcpy(pps->scaling_lists_8x8, sps->scaling_lists_8x8,
xine_fast_memcpy(pps->scaling_lists_8x8, sps->scaling_lists_8x8,
sizeof(pps->scaling_lists_8x8));
}
}
Expand Down

0 comments on commit 8e16730

Please sign in to comment.