mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2025-02-04 19:26:18 +00:00
a64multienc: Do not entangle coded_frame
This change (and the following ones of the same kind) is mainly to simplify wrapping this section with an #if FF_API block later on. No functional changes are applied, the fields of the context coded_frame fields are directly initialized, instead of keeping a reference to the coded_frame itself. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
This commit is contained in:
parent
95e2317ed8
commit
91767360d8
@ -44,7 +44,8 @@ static const int mc_colors[5]={0x0,0xb,0xc,0xf,0x1};
|
|||||||
//static const int mc_colors[5]={0x0,0x8,0xa,0xf,0x7};
|
//static const int mc_colors[5]={0x0,0x8,0xa,0xf,0x7};
|
||||||
//static const int mc_colors[5]={0x0,0x9,0x8,0xa,0x3};
|
//static const int mc_colors[5]={0x0,0x9,0x8,0xa,0x3};
|
||||||
|
|
||||||
static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
|
static void to_meta_with_crop(AVCodecContext *avctx,
|
||||||
|
const AVFrame *p, int *dest)
|
||||||
{
|
{
|
||||||
int blockx, blocky, x, y;
|
int blockx, blocky, x, y;
|
||||||
int luma = 0;
|
int luma = 0;
|
||||||
@ -252,7 +253,6 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
const AVFrame *pict, int *got_packet)
|
const AVFrame *pict, int *got_packet)
|
||||||
{
|
{
|
||||||
A64Context *c = avctx->priv_data;
|
A64Context *c = avctx->priv_data;
|
||||||
AVFrame *const p = avctx->coded_frame;
|
|
||||||
|
|
||||||
int frame;
|
int frame;
|
||||||
int x, y;
|
int x, y;
|
||||||
@ -296,10 +296,9 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
} else {
|
} else {
|
||||||
/* fill up mc_meta_charset with data until lifetime exceeds */
|
/* fill up mc_meta_charset with data until lifetime exceeds */
|
||||||
if (c->mc_frame_counter < c->mc_lifetime) {
|
if (c->mc_frame_counter < c->mc_lifetime) {
|
||||||
*p = *pict;
|
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
|
||||||
p->pict_type = AV_PICTURE_TYPE_I;
|
avctx->coded_frame->key_frame = 1;
|
||||||
p->key_frame = 1;
|
to_meta_with_crop(avctx, pict, meta + 32000 * c->mc_frame_counter);
|
||||||
to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter);
|
|
||||||
c->mc_frame_counter++;
|
c->mc_frame_counter++;
|
||||||
if (c->next_pts == AV_NOPTS_VALUE)
|
if (c->next_pts == AV_NOPTS_VALUE)
|
||||||
c->next_pts = pict->pts;
|
c->next_pts = pict->pts;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user