You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/snowenc: AV_CODEC_CAP_ENCODER_RECON_FRAME support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "codec_internal.h"
|
#include "codec_internal.h"
|
||||||
#include "encode.h"
|
#include "encode.h"
|
||||||
|
#include "internal.h" //For AVCodecInternal.recon_frame
|
||||||
#include "me_cmp.h"
|
#include "me_cmp.h"
|
||||||
#include "packet_internal.h"
|
#include "packet_internal.h"
|
||||||
#include "snow_dwt.h"
|
#include "snow_dwt.h"
|
||||||
@@ -1580,6 +1581,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
{
|
{
|
||||||
SnowContext *s = avctx->priv_data;
|
SnowContext *s = avctx->priv_data;
|
||||||
RangeCoder * const c= &s->c;
|
RangeCoder * const c= &s->c;
|
||||||
|
AVCodecInternal *avci = avctx->internal;
|
||||||
AVFrame *pic;
|
AVFrame *pic;
|
||||||
const int width= s->avctx->width;
|
const int width= s->avctx->width;
|
||||||
const int height= s->avctx->height;
|
const int height= s->avctx->height;
|
||||||
@@ -1881,6 +1883,10 @@ redo_frame:
|
|||||||
s->encoding_error,
|
s->encoding_error,
|
||||||
(s->avctx->flags&AV_CODEC_FLAG_PSNR) ? SNOW_MAX_PLANES : 0,
|
(s->avctx->flags&AV_CODEC_FLAG_PSNR) ? SNOW_MAX_PLANES : 0,
|
||||||
s->current_picture->pict_type);
|
s->current_picture->pict_type);
|
||||||
|
if (s->avctx->flags & AV_CODEC_FLAG_RECON_FRAME) {
|
||||||
|
av_frame_unref(avci->recon_frame);
|
||||||
|
av_frame_ref(avci->recon_frame, s->current_picture);
|
||||||
|
}
|
||||||
|
|
||||||
pkt->size = ff_rac_terminate(c, 0);
|
pkt->size = ff_rac_terminate(c, 0);
|
||||||
if (s->current_picture->key_frame)
|
if (s->current_picture->key_frame)
|
||||||
@@ -1938,7 +1944,9 @@ const FFCodec ff_snow_encoder = {
|
|||||||
CODEC_LONG_NAME("Snow"),
|
CODEC_LONG_NAME("Snow"),
|
||||||
.p.type = AVMEDIA_TYPE_VIDEO,
|
.p.type = AVMEDIA_TYPE_VIDEO,
|
||||||
.p.id = AV_CODEC_ID_SNOW,
|
.p.id = AV_CODEC_ID_SNOW,
|
||||||
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
|
.p.capabilities = AV_CODEC_CAP_DR1 |
|
||||||
|
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE |
|
||||||
|
AV_CODEC_CAP_ENCODER_RECON_FRAME,
|
||||||
.priv_data_size = sizeof(SnowContext),
|
.priv_data_size = sizeof(SnowContext),
|
||||||
.init = encode_init,
|
.init = encode_init,
|
||||||
FF_CODEC_ENCODE_CB(encode_frame),
|
FF_CODEC_ENCODE_CB(encode_frame),
|
||||||
|
Reference in New Issue
Block a user