Added coeff data to picture-struct

This commit is contained in:
Marko Viitanen 2013-10-15 17:56:50 +03:00
parent db266e74ff
commit d9e6d8413d
3 changed files with 14 additions and 0 deletions

View file

@ -154,6 +154,9 @@ int main(int argc, char *argv[])
init_encoder_input(&encoder->in, input, cfg->width, cfg->height); init_encoder_input(&encoder->in, input, cfg->width, cfg->height);
// Init coeff data table
encoder->in.cur_pic->coeff = MALLOC(coefficient, cfg->width * cfg->height);
// Start coding cycle while data on input and not on the last frame // Start coding cycle while data on input and not on the last frame
while(!feof(input) && (!cfg->frames || encoder->frame < cfg->frames)) { while(!feof(input) && (!cfg->frames || encoder->frame < cfg->frames)) {
int32_t diff; int32_t diff;
@ -202,6 +205,10 @@ int main(int argc, char *argv[])
// TODO: reuse memory from old reference // TODO: reuse memory from old reference
encoder->in.cur_pic = picture_init(encoder->in.width, encoder->in.height, encoder->in.width_in_lcu, encoder->in.height_in_lcu); encoder->in.cur_pic = picture_init(encoder->in.width, encoder->in.height, encoder->in.width_in_lcu, encoder->in.height_in_lcu);
// Copy pointer from the last cur_pic because we don't want to reallocate it
encoder->in.cur_pic->coeff = encoder->ref->pics[0]->coeff;
encoder->ref->pics[0]->coeff = NULL;
encoder->frame++; encoder->frame++;
} }
// Coding finished // Coding finished

View file

@ -244,6 +244,8 @@ picture *picture_init(int32_t width, int32_t height,
memset(pic->cu_array[i], 0, sizeof(cu_info) * cu_array_size); memset(pic->cu_array[i], 0, sizeof(cu_info) * cu_array_size);
} }
pic->coeff = NULL;
return pic; return pic;
} }
@ -275,6 +277,9 @@ int picture_destroy(picture *pic)
free(pic->cu_array); free(pic->cu_array);
pic->cu_array = NULL; pic->cu_array = NULL;
free(pic->coeff);
pic->coeff = NULL;
return 1; return 1;
} }

View file

@ -73,6 +73,8 @@ typedef struct
pixel* u_recdata; // \brief Pointer to reconstructed U-data. pixel* u_recdata; // \brief Pointer to reconstructed U-data.
pixel* v_recdata; // \brief Pointer to reconstructed V-data. pixel* v_recdata; // \brief Pointer to reconstructed V-data.
coefficient* coeff; //!< \brief coefficient pointer
int32_t width; // \brief Luma pixel array width. int32_t width; // \brief Luma pixel array width.
int32_t height; // \brief Luma pixel array height. int32_t height; // \brief Luma pixel array height.
int32_t height_in_lcu; // \brief Picture width in number of LCU's. int32_t height_in_lcu; // \brief Picture width in number of LCU's.