| 1086 | } |
| 1087 | |
| 1088 | av_cold int ff_mpv_encode_end(AVCodecContext *avctx) |
| 1089 | { |
| 1090 | MPVMainEncContext *const m = avctx->priv_data; |
| 1091 | MPVEncContext *const s = &m->s; |
| 1092 | |
| 1093 | ff_rate_control_uninit(&m->rc_context); |
| 1094 | |
| 1095 | ff_mpv_common_end(&s->c); |
| 1096 | av_refstruct_pool_uninit(&s->c.picture_pool); |
| 1097 | |
| 1098 | for (int i = 0; i < MPVENC_MAX_B_FRAMES + 1; i++) { |
| 1099 | av_refstruct_unref(&m->input_picture[i]); |
| 1100 | av_refstruct_unref(&m->reordered_input_picture[i]); |
| 1101 | } |
| 1102 | for (int i = 0; i < FF_ARRAY_ELEMS(m->tmp_frames); i++) |
| 1103 | av_frame_free(&m->tmp_frames[i]); |
| 1104 | |
| 1105 | av_frame_free(&s->new_pic); |
| 1106 | |
| 1107 | av_freep(&avctx->stats_out); |
| 1108 | |
| 1109 | av_freep(&m->mv_table_base); |
| 1110 | av_freep(&s->p_field_select_table[0]); |
| 1111 | av_freep(&m->dct_error_sum_base); |
| 1112 | |
| 1113 | av_freep(&s->mb_type); |
| 1114 | av_freep(&s->lambda_table); |
| 1115 | |
| 1116 | av_freep(&s->q_intra_matrix); |
| 1117 | av_freep(&s->q_intra_matrix16); |
| 1118 | av_freep(&s->dct_offset); |
| 1119 | |
| 1120 | return 0; |
| 1121 | } |
| 1122 | |
| 1123 | /* put block[] to dest[] */ |
| 1124 | static inline void put_dct(MPVEncContext *const s, |
no test coverage detected