comparison libmpeg2/decode.c @ 1652:e78cf3fc992e

shmem_alloc->memalign, adding function to free memory
author arpi
date Thu, 23 Aug 2001 11:54:08 +0000
parents 3c33deb3e561
children 1d741dfa190c
comparison
equal deleted inserted replaced
1651:b8721b5ab23e 1652:e78cf3fc992e
79 config.flags |= MM_ACCEL_MLIB; 79 config.flags |= MM_ACCEL_MLIB;
80 #endif 80 #endif
81 81
82 // printf("libmpeg2 config flags = 0x%X\n",config.flags); 82 // printf("libmpeg2 config flags = 0x%X\n",config.flags);
83 83
84 picture=shmem_alloc(sizeof(picture_t)); // !!! NEW HACK :) !!! 84 picture=malloc(sizeof(picture_t)); // !!! NEW HACK :) !!!
85 85
86 header_state_init (picture); 86 header_state_init (picture);
87 // picture->repeat_count=0; 87 // picture->repeat_count=0;
88 88
89 picture->pp_options=0; 89 picture->pp_options=0;
112 #ifdef MPEG12_POSTPROC 112 #ifdef MPEG12_POSTPROC
113 for(i=0;i<4;i++){ 113 for(i=0;i<4;i++){
114 #else 114 #else
115 for(i=0;i<3;i++){ 115 for(i=0;i<3;i++){
116 #endif 116 #endif
117 base = shmem_alloc(buff_size); 117 base = memalign(64,buff_size);
118 frames[i].base[0] = base; 118 frames[i].base[0] = base;
119 frames[i].base[1] = base + frame_size * 5 / 4; 119 frames[i].base[1] = base + frame_size * 5 / 4;
120 frames[i].base[2] = base + frame_size; 120 frames[i].base[2] = base + frame_size;
121 frames[i].copy = NULL; 121 frames[i].copy = NULL;
122 frames[i].vo = NULL; 122 frames[i].vo = NULL;
123 } 123 }
124 124
125 picture->forward_reference_frame=&frames[0]; 125 picture->forward_reference_frame=&frames[0];
126 picture->backward_reference_frame=&frames[1]; 126 picture->backward_reference_frame=&frames[1];
127 picture->current_frame=&frames[2]; 127 picture->current_frame=&frames[2];
128
129 }
130
131 void mpeg2_free_image_buffers (picture_t * picture){
132 int i;
133
134 #ifdef MPEG12_POSTPROC
135 for(i=0;i<4;i++){
136 #else
137 for(i=0;i<3;i++){
138 #endif
139 free(frames[i].base[0]);
140 }
128 141
129 } 142 }
130 143
131 static void copy_slice (vo_frame_t * frame, uint8_t ** src){ 144 static void copy_slice (vo_frame_t * frame, uint8_t ** src){
132 vo_functions_t * output = frame->vo; 145 vo_functions_t * output = frame->vo;