diff options
author | Oded Shimon <ods15@ods15.dyndns.org> | 2006-10-02 06:09:12 +0000 |
---|---|---|
committer | Oded Shimon <ods15@ods15.dyndns.org> | 2006-10-02 06:09:12 +0000 |
commit | ccc0fbf3c4a08df35a379bc580a8554d7a369f72 (patch) | |
tree | 71b6ee3de52b06101b69b2cd50fa3e84d034af66 /libavcodec/vorbis_enc.c | |
parent | 8d38e5e5f0bff22975fc4a1daa22cf87dbac5ad3 (diff) | |
download | ffmpeg-ccc0fbf3c4a08df35a379bc580a8554d7a369f72.tar.gz |
Original Commit: r98 | ods15 | 2006-10-01 10:15:33 +0200 (Sun, 01 Oct 2006) | 2 lines
switch to int8_t for residue codebook numbers, use memcpy in residue init
Originally committed as revision 6502 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vorbis_enc.c')
-rw-r--r-- | libavcodec/vorbis_enc.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c index 4262f93b94..3deb4137a9 100644 --- a/libavcodec/vorbis_enc.c +++ b/libavcodec/vorbis_enc.c @@ -81,7 +81,7 @@ typedef struct { int partition_size; int classifications; int classbook; - int (*books)[8]; + int8_t (*books)[8]; float (*maxes)[2]; } residue_t; @@ -466,9 +466,9 @@ static void create_vorbis_context(venc_context_t * venc, AVCodecContext * avccon rc->partition_size = 32; rc->classifications = 10; rc->classbook = 15; - rc->books = av_malloc(sizeof(int[8]) * rc->classifications); - for (i = 0; i < rc->classifications; i++) { - int a[10][8] = { + rc->books = av_malloc(sizeof(*rc->books) * rc->classifications); + { + static const int8_t a[10][8] = { { -1, -1, -1, -1, -1, -1, -1, -1, }, { -1, -1, 16, -1, -1, -1, -1, -1, }, { -1, -1, 17, -1, -1, -1, -1, -1, }, @@ -480,8 +480,7 @@ static void create_vorbis_context(venc_context_t * venc, AVCodecContext * avccon { 24, 25, -1, -1, -1, -1, -1, -1, }, { 26, 27, 28, -1, -1, -1, -1, -1, }, }; - int j; - for (j = 0; j < 8; j++) rc->books[i][j] = a[i][j]; + memcpy(rc->books, a, sizeof a); } ready_residue(rc, venc); |