1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/encoders: Remove redundant setting of AV_PKT_FLAG_KEY

It is now set generically for all those encoders whose corresponding
AVCodecDescriptor has the AV_CODEC_PROP_INTRA_ONLY.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-09-22 00:09:54 +02:00
parent 3f11eac757
commit ed6549887a
42 changed files with 0 additions and 46 deletions

View File

@ -385,7 +385,6 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
c->next_pts = AV_NOPTS_VALUE; c->next_pts = AV_NOPTS_VALUE;
av_assert0(pkt->size == req_size); av_assert0(pkt->size == req_size);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = !!req_size; *got_packet = !!req_size;
} }
return 0; return 0;

View File

@ -96,7 +96,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* Total length */ /* Total length */
av_shrink_packet(pkt, buf - pkt->data); av_shrink_packet(pkt, buf - pkt->data);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -299,7 +299,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
} }
pkt->size = size * 4; pkt->size = size * 4;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -87,7 +87,6 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
} }
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -154,7 +154,6 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
ptr -= p->linesize[0]; // ... and go back ptr -= p->linesize[0]; // ... and go back
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -91,7 +91,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
flush_put_bits(&pb); flush_put_bits(&pb);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -1308,7 +1308,6 @@ encode_coding_unit:
ff_side_data_set_encoder_stats(pkt, ctx->qscale * FF_QP2LAMBDA, NULL, 0, AV_PICTURE_TYPE_I); ff_side_data_set_encoder_stats(pkt, ctx->qscale * FF_QP2LAMBDA, NULL, 0, AV_PICTURE_TYPE_I);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -271,7 +271,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
write32(buf + 16, size); /* file size */ write32(buf + 16, size); /* file size */
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -1187,7 +1187,6 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt,
emms_c(); emms_c();
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -507,7 +507,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
av_shrink_packet(pkt, bytestream2_tell_p(pb)); av_shrink_packet(pkt, bytestream2_tell_p(pb));
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -105,7 +105,6 @@ static int fits_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytes_left = padded_data_size - data_size; bytes_left = padded_data_size - data_size;
memset(bytestream, 0, bytes_left); memset(bytestream, 0, bytes_left);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -229,7 +229,6 @@ static int hap_encode(AVCodecContext *avctx, AVPacket *pkt,
hap_write_frame_header(ctx, pkt->data, final_data_size + header_length); hap_write_frame_header(ctx, pkt->data, final_data_size + header_length);
av_shrink_packet(pkt, final_data_size + header_length); av_shrink_packet(pkt, final_data_size + header_length);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -994,7 +994,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s->picture_number++; s->picture_number++;
pkt->size = size * 4; pkt->size = size * 4;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -1661,7 +1661,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
av_log(s->avctx, AV_LOG_DEBUG, "end\n"); av_log(s->avctx, AV_LOG_DEBUG, "end\n");
pkt->size = s->buf - s->buf_start; pkt->size = s->buf - s->buf_start;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -415,7 +415,6 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
emms_c(); emms_c();
pkt->flags |= AV_PKT_FLAG_KEY;
av_shrink_packet(pkt, bytestream2_tell_p(&pb)); av_shrink_packet(pkt, bytestream2_tell_p(&pb));
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -103,7 +103,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
} }
pkt->size = c->zstream.total_out; pkt->size = c->zstream.total_out;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -708,7 +708,6 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
av_shrink_packet(pkt, writer.pos); av_shrink_packet(pkt, writer.pos);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
ret = 0; ret = 0;

View File

@ -63,7 +63,6 @@ static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
goto end; goto end;
memcpy(pkt->data, mw.mem, mw.size); memcpy(pkt->data, mw.mem, mw.size);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
end: end:

View File

@ -73,7 +73,6 @@ static int libwebp_anim_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return ret; return ret;
memcpy(pkt->data, assembled_data.bytes, assembled_data.size); memcpy(pkt->data, assembled_data.bytes, assembled_data.size);
s->done = 1; s->done = 1;
pkt->flags |= AV_PKT_FLAG_KEY;
pkt->pts = pkt->dts = s->first_frame_pts; pkt->pts = pkt->dts = s->first_frame_pts;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -259,7 +259,6 @@ static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
flush_put_bits(&pb); flush_put_bits(&pb);
pkt->size = put_bits_ptr(&pb) - pb.buf; pkt->size = put_bits_ptr(&pb) - pb.buf;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -522,7 +522,6 @@ static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream2_seek_p(&pb, pos, SEEK_SET); bytestream2_seek_p(&pb, pos, SEEK_SET);
pkt->size = bytestream2_tell_p(&pb); pkt->size = bytestream2_tell_p(&pb);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;

View File

@ -123,7 +123,6 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
} }
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -187,7 +187,6 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
} }
pkt->size = buf - pkt->data; pkt->size = buf - pkt->data;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -142,7 +142,6 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
ptr2 += p->linesize[2]; ptr2 += p->linesize[2];
} }
} }
pkt->flags |= AV_PKT_FLAG_KEY;
av_shrink_packet(pkt, bytestream - bytestream_start); av_shrink_packet(pkt, bytestream - bytestream_start);
*got_packet = 1; *got_packet = 1;

View File

@ -795,7 +795,6 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
} }
AV_WB32(pkt->data, compress_frame_size);/* update frame size */ AV_WB32(pkt->data, compress_frame_size);/* update frame size */
pkt->flags |= AV_PKT_FLAG_KEY;
pkt->size = compress_frame_size; pkt->size = compress_frame_size;
*got_packet = 1; *got_packet = 1;

View File

@ -1136,7 +1136,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream_put_be32(&orig_buf, frame_size); bytestream_put_be32(&orig_buf, frame_size);
pkt->size = frame_size; pkt->size = frame_size;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -81,7 +81,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
srcb_line += pic->linesize[1]; srcb_line += pic->linesize[1];
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -76,7 +76,6 @@ static int raw_encode(AVCodecContext *avctx, AVPacket *pkt,
AV_WB64(&pkt->data[8 * x], v << 48 | v >> 16); AV_WB64(&pkt->data[8 * x], v << 48 | v >> 16);
} }
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -250,7 +250,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* total length */ /* total length */
pkt->size = bytestream2_tell_p(&pbc); pkt->size = bytestream2_tell_p(&pbc);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -189,7 +189,6 @@ static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
AV_WB32(&avpkt->data[16], s->length); AV_WB32(&avpkt->data[16], s->length);
*got_packet_ptr = 1; *got_packet_ptr = 1;
avpkt->flags |= AV_PKT_FLAG_KEY;
avpkt->size = bytestream2_tell_p(&s->p); avpkt->size = bytestream2_tell_p(&s->p);
return 0; return 0;
} }

View File

@ -172,7 +172,6 @@ static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
memcpy(out, "\0\0\0\0\0\0\0\0TRUEVISION-XFILE.", 26); memcpy(out, "\0\0\0\0\0\0\0\0TRUEVISION-XFILE.", 26);
pkt->size = out + 26 - pkt->data; pkt->size = out + 26 - pkt->data;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -515,7 +515,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream_put_le32(&ptr, 0); bytestream_put_le32(&ptr, 0);
pkt->size = ptr - pkt->data; pkt->size = ptr - pkt->data;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
fail: fail:

View File

@ -616,11 +616,6 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
frame_info = c->frame_pred << 8; frame_info = c->frame_pred << 8;
bytestream2_put_le32(&pb, frame_info); bytestream2_put_le32(&pb, frame_info);
/*
* At least currently Ut Video is IDR only.
* Set flags accordingly.
*/
pkt->flags |= AV_PKT_FLAG_KEY;
pkt->size = bytestream2_tell_p(&pb); pkt->size = bytestream2_tell_p(&pb);
/* Packet should be done */ /* Packet should be done */

View File

@ -147,7 +147,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
memcpy(buf, side_data->data, side_data->size); memcpy(buf, side_data->data, side_data->size);
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -65,7 +65,6 @@ static int v308_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
v += pic->linesize[2]; v += pic->linesize[2];
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -70,7 +70,6 @@ static int v408_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
a += pic->linesize[3]; a += pic->linesize[3];
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -69,7 +69,6 @@ static int v410_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
v += pic->linesize[2] >> 1; v += pic->linesize[2] >> 1;
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -71,7 +71,6 @@ static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
buf += snprintf(buf, 5, " };\n"); buf += snprintf(buf, 5, " };\n");
pkt->size = buf - pkt->data; pkt->size = buf - pkt->data;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -206,7 +206,6 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
*(p++) = '\n'; *(p++) = '\n';
*(p++) = 0; *(p++) = 0;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;

View File

@ -211,7 +211,6 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
ptr += p->linesize[0]; ptr += p->linesize[0];
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -72,7 +72,6 @@ static int y41p_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
} }
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }

View File

@ -55,7 +55,6 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
v += pic->linesize[2]; v += pic->linesize[2];
} }
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1; *got_packet = 1;
return 0; return 0;
} }