aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libavcodec/mpegvideo.c5
-rw-r--r--libavcodec/mpegvideo.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index a4d29ba900..96ae20b14e 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -442,6 +442,9 @@ int MPV_common_init(MpegEncContext *s)
CHECKED_ALLOCZ(s->mb_type , mb_array_size * sizeof(uint8_t)) //needed for encoding
CHECKED_ALLOCZ(s->lambda_table, mb_array_size * sizeof(int))
+
+ CHECKED_ALLOCZ(s->q_intra_matrix, 64*32 * sizeof(int))
+ CHECKED_ALLOCZ(s->q_inter_matrix, 64*32 * sizeof(int))
}
CHECKED_ALLOCZ(s->picture, MAX_PICTURE_COUNT * sizeof(Picture))
@@ -560,6 +563,8 @@ void MPV_common_end(MpegEncContext *s)
av_freep(&s->error_status_table);
av_freep(&s->mb_index2xy);
av_freep(&s->lambda_table);
+ av_freep(&s->q_intra_matrix);
+ av_freep(&s->q_inter_matrix);
for(i=0; i<MAX_PICTURE_COUNT; i++){
free_picture(s, &s->picture[i]);
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index e557a81d1e..352e012279 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -457,8 +457,8 @@ typedef struct MpegEncContext {
int coded_score[6];
/** precomputed matrix (combine qscale and DCT renorm) */
- int __align8 q_intra_matrix[32][64];
- int __align8 q_inter_matrix[32][64];
+ int (*q_intra_matrix)[64];
+ int (*q_inter_matrix)[64];
/** identical to the above but for MMX & these are not permutated */
uint16_t __align8 q_intra_matrix16[32][64];
uint16_t __align8 q_inter_matrix16[32][64];