* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/imgutils.h"
+
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
int i, h, w, n, linesize, depth, maxval, ret;
const char *tuple_type;
uint8_t *ptr;
+ int size = av_image_get_buffer_size(avctx->pix_fmt,
+ avctx->width, avctx->height, 1);
- if ((ret = ff_alloc_packet(pkt, avpicture_get_size(avctx->pix_fmt,
- avctx->width,
- avctx->height) + 200)) < 0) {
+ if ((ret = ff_alloc_packet(pkt, size + 200)) < 0) {
av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
return ret;
}
static av_cold int pam_encode_init(AVCodecContext *avctx)
{
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
return 0;
}