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>
... | ... |
@@ -44,7 +44,8 @@ static const int mc_colors[5]={0x0,0xb,0xc,0xf,0x1}; |
44 | 44 |
//static const int mc_colors[5]={0x0,0x8,0xa,0xf,0x7}; |
45 | 45 |
//static const int mc_colors[5]={0x0,0x9,0x8,0xa,0x3}; |
46 | 46 |
|
47 |
-static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest) |
|
47 |
+static void to_meta_with_crop(AVCodecContext *avctx, |
|
48 |
+ const AVFrame *p, int *dest) |
|
48 | 49 |
{ |
49 | 50 |
int blockx, blocky, x, y; |
50 | 51 |
int luma = 0; |
... | ... |
@@ -252,7 +253,6 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt, |
252 | 252 |
const AVFrame *pict, int *got_packet) |
253 | 253 |
{ |
254 | 254 |
A64Context *c = avctx->priv_data; |
255 |
- AVFrame *const p = avctx->coded_frame; |
|
256 | 255 |
|
257 | 256 |
int frame; |
258 | 257 |
int x, y; |
... | ... |
@@ -296,10 +296,9 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt, |
296 | 296 |
} else { |
297 | 297 |
/* fill up mc_meta_charset with data until lifetime exceeds */ |
298 | 298 |
if (c->mc_frame_counter < c->mc_lifetime) { |
299 |
- *p = *pict; |
|
300 |
- p->pict_type = AV_PICTURE_TYPE_I; |
|
301 |
- p->key_frame = 1; |
|
302 |
- to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter); |
|
299 |
+ avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; |
|
300 |
+ avctx->coded_frame->key_frame = 1; |
|
301 |
+ to_meta_with_crop(avctx, pict, meta + 32000 * c->mc_frame_counter); |
|
303 | 302 |
c->mc_frame_counter++; |
304 | 303 |
if (c->next_pts == AV_NOPTS_VALUE) |
305 | 304 |
c->next_pts = pict->pts; |