History

avcodec: remove FF_API_FLAG_TRUNCATED

James Almer committed 3 years ago

Commit 3ceffe71 parent 5f9e84819 files · +1 −293Browse files

Unified · Split

19 files
  1. libavcodec/avcodec.h +0 −9
  2. libavcodec/codec.h +0 −6
  3. libavcodec/decode.c +0 −4
  4. libavcodec/h263_parser.c +0 −11
  5. libavcodec/h263_parser.h +0 −29
  6. libavcodec/h263dec.c +0 −42
  7. libavcodec/mpeg12.c +0 −66
  8. libavcodec/mpeg12.h +0 −9
  9. libavcodec/mpeg12dec.c +0 −31
  10. libavcodec/mpeg4video_parser.c +0 −12
  11. libavcodec/mpeg4video_parser.h +0 −34
  12. libavcodec/mpeg4videodec.c +0 −3
  13. libavcodec/mpegvideo.c +0 −9
  14. libavcodec/mpegvideo.h +0 −7
  15. libavcodec/mpegvideo_dec.c +0 −8
  16. libavcodec/mpegvideo_parser.c +1 −6
  17. libavcodec/options_table.h +0 −3
  18. libavcodec/pthread.c +0 −3
  19. libavcodec/version_major.h +0 −1
libavcodec/avcodec.h+0−9
@@ -303,15 +303,6 @@ typedef struct RcOverride{ · 302 unmodified lines
303303 * error[?] variables will be set during encoding.
304304 */
305305 #define AV_CODEC_FLAG_PSNR (1 << 15)
306−#if FF_API_FLAG_TRUNCATED
307−/**
308− * Input bitstream might be truncated at a random location
309− * instead of only at frame boundaries.
310− *
311− * @deprecated use codec parsers for packetizing input
312− */
313−#define AV_CODEC_FLAG_TRUNCATED (1 << 16)
314−#endif
315306 /**
316307 * Use interlaced DCT.
317308 */
libavcodec/codec.h+0−6
@@ -50,12 +50,6 @@ · 49 unmodified lines
5050 * avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer.
5151 */
5252 #define AV_CODEC_CAP_DR1 (1 << 1)
53−#if FF_API_FLAG_TRUNCATED
54−/**
55− * @deprecated Use parsers to always send proper frames.
56− */
57−#define AV_CODEC_CAP_TRUNCATED (1 << 3)
58−#endif
5953 /**
6054 * Encoder or decoder requires flushing with NULL input at the end in order to
6155 * give the complete and correct output.
libavcodec/decode.c+0−4
@@ -427,11 +427,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 426 unmodified lines
427427 if (!got_frame)
428428 av_frame_unref(frame);
429429
430−#if FF_API_FLAG_TRUNCATED
431− if (ret >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED))
432−#else
433430 if (ret >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO)
434−#endif
435431 ret = pkt->size;
436432
437433 /* do not stop draining when actual_got_frame != 0 or ret < 0 */
libavcodec/h263_parser.c+0−11
@@ -25,16 +25,9 @@ · 24 unmodified lines
2525 */
2626
2727 #include "parser.h"
28−#if FF_API_FLAG_TRUNCATED
29−/* Nuke this header when removing FF_API_FLAG_TRUNCATED */
30−#include "h263_parser.h"
31−
32−int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
33−#else
3428
3529 static int h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
3630 {
37−#endif
3831 int vop_found, i;
3932 uint32_t state;
4033
@@ -80,11 +73,7 @@ static int h263_parse(AVCodecParserContext *s, · 39 unmodified lines
8073 if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
8174 next = buf_size;
8275 } else {
83−#if FF_API_FLAG_TRUNCATED
84− next= ff_h263_find_frame_end(pc, buf, buf_size);
85−#else
8676 next = h263_find_frame_end(pc, buf, buf_size);
87−#endif
8877
8978 if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
9079 *poutbuf = NULL;
libavcodec/h263_parser.h+0−29
@@ -1,29 +0,0 @@
1−/*
2− * H.263 parser
3− * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
4− *
5− * This file is part of FFmpeg.
6− *
7− * FFmpeg is free software; you can redistribute it and/or
8− * modify it under the terms of the GNU Lesser General Public
9− * License as published by the Free Software Foundation; either
10− * version 2.1 of the License, or (at your option) any later version.
11− *
12− * FFmpeg is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15− * Lesser General Public License for more details.
16− *
17− * You should have received a copy of the GNU Lesser General Public
18− * License along with FFmpeg; if not, write to the Free Software
19− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20− */
21−
22−#ifndef AVCODEC_H263_PARSER_H
23−#define AVCODEC_H263_PARSER_H
24−
25−#include "parser.h"
26−
27−int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
28−
29−#endif /* AVCODEC_H263_PARSER_H */
libavcodec/h263dec.c+0−42
@@ -36,17 +36,11 @@ · 35 unmodified lines
3636 #include "flvdec.h"
3737 #include "h263.h"
3838 #include "h263dec.h"
39−#if FF_API_FLAG_TRUNCATED
40−#include "h263_parser.h"
41−#endif
4239 #include "hwconfig.h"
4340 #include "mpeg_er.h"
4441 #include "mpeg4video.h"
4542 #include "mpeg4videodec.h"
4643 #include "mpeg4videodefs.h"
47−#if FF_API_FLAG_TRUNCATED
48−#include "mpeg4video_parser.h"
49−#endif
5044 #include "mpegutils.h"
5145 #include "mpegvideo.h"
5246 #include "mpegvideodec.h"
@@ -163,14 +157,6 @@ static int get_consumed_bytes(MpegEncContext *s, int buf_size) · 110 unmodified lines
163157 /* We would have to scan through the whole buf to handle the weird
164158 * reordering ... */
165159 return buf_size;
166−#if FF_API_FLAG_TRUNCATED
167− } else if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) {
168− pos -= s->parse_context.last_index;
169− // padding is not really read so this might be -1
170− if (pos < 0)
171− pos = 0;
172− return pos;
173−#endif
174160 } else {
175161 // avoid infinite loops (maybe not needed...)
176162 if (pos == 0)
@@ -448,28 +434,6 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 271 unmodified lines
448434 return 0;
449435 }
450436
451−#if FF_API_FLAG_TRUNCATED
452− if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) {
453− int next;
454−
455− if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4) {
456− next = ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size);
457− } else if (CONFIG_H263_DECODER && s->codec_id == AV_CODEC_ID_H263) {
458− next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size);
459− } else if (CONFIG_H263P_DECODER && s->codec_id == AV_CODEC_ID_H263P) {
460− next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size);
461− } else {
462− av_log(s->avctx, AV_LOG_ERROR,
463− "this codec does not support truncated bitstreams\n");
464− return AVERROR(ENOSYS);
465− }
466−
467− if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf,
468− &buf_size) < 0)
469− return buf_size;
470− }
471−#endif
472−
473437 retry:
474438 if (s->divx_packed && s->bitstream_buffer_size) {
475439 int i;
@@ -749,9 +713,6 @@ const FFCodec ff_h263_decoder = { · 273 unmodified lines
749713 .close = ff_h263_decode_end,
750714 FF_CODEC_DECODE_CB(ff_h263_decode_frame),
751715 .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
752−#if FF_API_FLAG_TRUNCATED
753− AV_CODEC_CAP_TRUNCATED |
754−#endif
755716 AV_CODEC_CAP_DELAY,
756717 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
757718 .flush = ff_mpeg_flush,
@@ -770,9 +731,6 @@ const FFCodec ff_h263p_decoder = { · 12 unmodified lines
770731 .close = ff_h263_decode_end,
771732 FF_CODEC_DECODE_CB(ff_h263_decode_frame),
772733 .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
773−#if FF_API_FLAG_TRUNCATED
774− AV_CODEC_CAP_TRUNCATED |
775−#endif
776734 AV_CODEC_CAP_DELAY,
777735 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
778736 .flush = ff_mpeg_flush,
libavcodec/mpeg12.c+0−66
@@ -167,72 +167,6 @@ av_cold void ff_mpeg12_init_vlcs(void) · 166 unmodified lines
167167 ff_thread_once(&init_static_once, mpeg12_init_vlcs);
168168 }
169169
170−#if FF_API_FLAG_TRUNCATED
171−/**
172− * Find the end of the current frame in the bitstream.
173− * @return the position of the first byte of the next frame, or -1
174− */
175−int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s)
176−{
177− int i;
178− uint32_t state = pc->state;
179−
180− /* EOF considered as end of frame */
181− if (buf_size == 0)
182− return 0;
183−
184−/*
185− 0 frame start -> 1/4
186− 1 first_SEQEXT -> 0/2
187− 2 first field start -> 3/0
188− 3 second_SEQEXT -> 2/0
189− 4 searching end
190−*/
191−
192− for (i = 0; i < buf_size; i++) {
193− av_assert1(pc->frame_start_found >= 0 && pc->frame_start_found <= 4);
194− if (pc->frame_start_found & 1) {
195− if (state == EXT_START_CODE && (buf[i] & 0xF0) != 0x80)
196− pc->frame_start_found--;
197− else if (state == EXT_START_CODE + 2) {
198− if ((buf[i] & 3) == 3)
199− pc->frame_start_found = 0;
200− else
201− pc->frame_start_found = (pc->frame_start_found + 1) & 3;
202− }
203− state++;
204− } else {
205− i = avpriv_find_start_code(buf + i, buf + buf_size, &state) - buf - 1;
206− if (pc->frame_start_found == 0 && state >= SLICE_MIN_START_CODE && state <= SLICE_MAX_START_CODE) {
207− i++;
208− pc->frame_start_found = 4;
209− }
210− if (state == SEQ_END_CODE) {
211− pc->frame_start_found = 0;
212− pc->state=-1;
213− return i+1;
214− }
215− if (pc->frame_start_found == 2 && state == SEQ_START_CODE)
216− pc->frame_start_found = 0;
217− if (pc->frame_start_found < 4 && state == EXT_START_CODE)
218− pc->frame_start_found++;
219− if (pc->frame_start_found == 4 && (state & 0xFFFFFF00) == 0x100) {
220− if (state < SLICE_MIN_START_CODE || state > SLICE_MAX_START_CODE) {
221− pc->frame_start_found = 0;
222− pc->state = -1;
223− return i - 3;
224− }
225− }
226− if (pc->frame_start_found == 0 && s && state == PICTURE_START_CODE) {
227− ff_fetch_timestamp(s, i - 3, 1, i > 3);
228− }
229− }
230− }
231− pc->state = state;
232− return END_NOT_FOUND;
233−}
234−#endif
235−
236170 #define MAX_INDEX (64 - 1)
237171
238172 int ff_mpeg1_decode_block_intra(GetBitContext *gb,
libavcodec/mpeg12.h+0−9
@@ -34,15 +34,6 @@ · 33 unmodified lines
3434 #define EXT_START_CODE 0x000001b5
3535 #define USER_START_CODE 0x000001b2
3636
37−#include "version_major.h"
38−#if FF_API_FLAG_TRUNCATED
39−#include <stdint.h>
40−
41−struct ParseContext;
42−struct AVCodecParserContext;
43−int ff_mpeg1_find_frame_end(struct ParseContext *pc, const uint8_t *buf, int buf_size, struct AVCodecParserContext *s);
44−#endif
45−
4637 void ff_mpeg12_find_best_frame_rate(AVRational frame_rate,
4738 int *code, int *ext_n, int *ext_d,
4839 int nonstandard);
libavcodec/mpeg12dec.c+0−31
@@ -1239,14 +1239,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) · 1238 unmodified lines
12391239 (s1->save_progressive_seq != s->progressive_sequence && FFALIGN(s->height, 16) != FFALIGN(s->height, 32)) ||
12401240 0) {
12411241 if (s1->mpeg_enc_ctx_allocated) {
1242−#if FF_API_FLAG_TRUNCATED
1243− ParseContext pc = s->parse_context;
1244− s->parse_context.buffer = 0;
12451242 ff_mpv_common_end(s);
1246− s->parse_context = pc;
1247−#else
1248− ff_mpv_common_end(s);
1249−#endif
12501243 s1->mpeg_enc_ctx_allocated = 0;
12511244 }
12521245
@@ -2482,11 +2475,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, · 1229 unmodified lines
24822475 if (avctx->err_recognition & AV_EF_EXPLODE && s2->er.error_count)
24832476 return AVERROR_INVALIDDATA;
24842477
2485−#if FF_API_FLAG_TRUNCATED
2486− return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);
2487−#else
24882478 return FFMAX(0, buf_ptr - buf);
2489−#endif
24902479 }
24912480
24922481 input_size = buf_end - buf_ptr;
@@ -2799,17 +2788,6 @@ static int mpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture, · 306 unmodified lines
27992788 return buf_size;
28002789 }
28012790
2802−#if FF_API_FLAG_TRUNCATED
2803− if (s2->avctx->flags & AV_CODEC_FLAG_TRUNCATED) {
2804− int next = ff_mpeg1_find_frame_end(&s2->parse_context, buf,
2805− buf_size, NULL);
2806−
2807− if (ff_combine_frame(&s2->parse_context, next,
2808− (const uint8_t **) &buf, &buf_size) < 0)
2809− return buf_size;
2810− }
2811−#endif
2812−
28132791 if (s->mpeg_enc_ctx_allocated == 0 && ( s2->codec_tag == AV_RL32("VCR2")
28142792 || s2->codec_tag == AV_RL32("BW10")
28152793 ))
@@ -2886,9 +2864,6 @@ const FFCodec ff_mpeg1video_decoder = { · 70 unmodified lines
28862864 .close = mpeg_decode_end,
28872865 FF_CODEC_DECODE_CB(mpeg_decode_frame),
28882866 .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
2889−#if FF_API_FLAG_TRUNCATED
2890− AV_CODEC_CAP_TRUNCATED |
2891−#endif
28922867 AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
28932868 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
28942869 .flush = flush,
@@ -2918,9 +2893,6 @@ const FFCodec ff_mpeg2video_decoder = { · 23 unmodified lines
29182893 .close = mpeg_decode_end,
29192894 FF_CODEC_DECODE_CB(mpeg_decode_frame),
29202895 .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
2921−#if FF_API_FLAG_TRUNCATED
2922− AV_CODEC_CAP_TRUNCATED |
2923−#endif
29242896 AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
29252897 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
29262898 .flush = flush,
@@ -2963,9 +2935,6 @@ const FFCodec ff_mpegvideo_decoder = { · 36 unmodified lines
29632935 .close = mpeg_decode_end,
29642936 FF_CODEC_DECODE_CB(mpeg_decode_frame),
29652937 .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
2966−#if FF_API_FLAG_TRUNCATED
2967− AV_CODEC_CAP_TRUNCATED |
2968−#endif
29692938 AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
29702939 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
29712940 .flush = flush,
libavcodec/mpeg4video_parser.c+0−12
@@ -27,10 +27,6 @@ · 26 unmodified lines
2727 #include "mpegvideo.h"
2828 #include "mpeg4videodec.h"
2929 #include "mpeg4videodefs.h"
30−#if FF_API_FLAG_TRUNCATED
31−/* Nuke this header when removing FF_API_FLAG_TRUNCATED */
32−#include "mpeg4video_parser.h"
33−#endif
3430
3531 struct Mp4vParseContext {
3632 ParseContext pc;
@@ -38,15 +34,11 @@ struct Mp4vParseContext { · 1 unmodified line
3834 int first_picture;
3935 };
4036
41−#if FF_API_FLAG_TRUNCATED
42−int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
43−#else
4437 /**
4538 * Find the end of the current frame in the bitstream.
4639 * @return the position of the first byte of the next frame, or -1
4740 */
4841 static int mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
49−#endif
5042 {
5143 int vop_found, i;
5244 uint32_t state;
@@ -148,11 +140,7 @@ static int mpeg4video_parse(AVCodecParserContext *s, · 95 unmodified lines
148140 if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
149141 next = buf_size;
150142 } else {
151−#if FF_API_FLAG_TRUNCATED
152− next = ff_mpeg4_find_frame_end(pc, buf, buf_size);
153−#else
154143 next = mpeg4_find_frame_end(pc, buf, buf_size);
155−#endif
156144
157145 if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
158146 *poutbuf = NULL;
libavcodec/mpeg4video_parser.h+0−34
@@ -1,34 +0,0 @@
1−/*
2− * MPEG-4 video parser prototypes
3− * Copyright (c) 2003 Fabrice Bellard
4− * Copyright (c) 2003 Michael Niedermayer
5− *
6− * This file is part of FFmpeg.
7− *
8− * FFmpeg is free software; you can redistribute it and/or
9− * modify it under the terms of the GNU Lesser General Public
10− * License as published by the Free Software Foundation; either
11− * version 2.1 of the License, or (at your option) any later version.
12− *
13− * FFmpeg is distributed in the hope that it will be useful,
14− * but WITHOUT ANY WARRANTY; without even the implied warranty of
15− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16− * Lesser General Public License for more details.
17− *
18− * You should have received a copy of the GNU Lesser General Public
19− * License along with FFmpeg; if not, write to the Free Software
20− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21− */
22−
23−#ifndef AVCODEC_MPEG4VIDEO_PARSER_H
24−#define AVCODEC_MPEG4VIDEO_PARSER_H
25−
26−#include "parser.h"
27−
28−/**
29− * Find the end of the current frame in the bitstream.
30− * @return the position of the first byte of the next frame, or -1
31− */
32−int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
33−
34−#endif /* AVCODEC_MPEG4VIDEO_PARSER_H */
libavcodec/mpeg4videodec.c+0−3
@@ -3859,9 +3859,6 @@ const FFCodec ff_mpeg4_decoder = { · 3858 unmodified lines
38593859 .close = ff_h263_decode_end,
38603860 FF_CODEC_DECODE_CB(ff_h263_decode_frame),
38613861 .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
3862−#if FF_API_FLAG_TRUNCATED
3863− AV_CODEC_CAP_TRUNCATED |
3864−#endif
38653862 AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS,
38663863 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM |
38673864 FF_CODEC_CAP_ALLOCATE_PROGRESS,
libavcodec/mpegvideo.c+0−9
@@ -738,10 +738,6 @@ av_cold int ff_mpv_common_init(MpegEncContext *s) · 737 unmodified lines
738738 nb_slices = max_slices;
739739 }
740740
741−#if FF_API_FLAG_TRUNCATED
742− s->parse_context.state = -1;
743−#endif
744−
745741 s->context_initialized = 1;
746742 memset(s->thread_context, 0, sizeof(s->thread_context));
747743 s->thread_context[0] = s;
@@ -791,11 +787,6 @@ void ff_mpv_common_end(MpegEncContext *s) · 43 unmodified lines
791787 if (s->slice_context_count > 1)
792788 s->slice_context_count = 1;
793789
794−#if FF_API_FLAG_TRUNCATED
795− av_freep(&s->parse_context.buffer);
796− s->parse_context.buffer_size = 0;
797−#endif
798−
799790 av_freep(&s->bitstream_buffer);
800791 s->allocated_bitstream_buffer_size = 0;
801792
libavcodec/mpegvideo.h+0−7
@@ -44,9 +44,6 @@ · 43 unmodified lines
4444 #include "pixblockdsp.h"
4545 #include "put_bits.h"
4646 #include "ratecontrol.h"
47−#if FF_API_FLAG_TRUNCATED
48−#include "parser.h"
49−#endif
5047 #include "mpegutils.h"
5148 #include "qpeldsp.h"
5249 #include "videodsp.h"
@@ -353,10 +350,6 @@ typedef struct MpegEncContext { · 300 unmodified lines
353350 GetBitContext last_resync_gb; ///< used to search for the next resync marker
354351 int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only)
355352
356−#if FF_API_FLAG_TRUNCATED
357− ParseContext parse_context;
358−#endif
359−
360353 /* H.263 specific */
361354 int gob_index;
362355 int obmc; ///< overlapped block motion compensation
libavcodec/mpegvideo_dec.c+0−8
@@ -554,14 +554,6 @@ void ff_mpeg_flush(AVCodecContext *avctx) · 553 unmodified lines
554554
555555 s->mb_x = s->mb_y = 0;
556556
557−#if FF_API_FLAG_TRUNCATED
558− s->parse_context.state = -1;
559− s->parse_context.frame_start_found = 0;
560− s->parse_context.overread = 0;
561− s->parse_context.overread_index = 0;
562− s->parse_context.index = 0;
563− s->parse_context.last_index = 0;
564−#endif
565557 s->bitstream_buffer_size = 0;
566558 s->pp_time = 0;
567559 }
libavcodec/mpegvideo_parser.c+1−6
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121 */
2222
23+#include "libavutil/avassert.h"
2324 #include "decode.h"
2425 #include "parser.h"
2526 #include "mpeg12.h"
@@ -33,7 +34,6 @@ struct MpvParseContext { · 7 unmodified lines
3334 int width, height;
3435 };
3536
36−#if !FF_API_FLAG_TRUNCATED
3737 /**
3838 * Find the end of the current frame in the bitstream.
3939 * @return the position of the first byte of the next frame, or -1
@@ -98,7 +98,6 @@ static int mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, · 58 unmodified lines
9898 pc->state = state;
9999 return END_NOT_FOUND;
100100 }
101−#endif
102101
103102 static void mpegvideo_extract_headers(AVCodecParserContext *s,
104103 AVCodecContext *avctx,
@@ -255,11 +254,7 @@ static int mpegvideo_parse(AVCodecParserContext *s, · 150 unmodified lines
255254 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
256255 next= buf_size;
257256 }else{
258−#if FF_API_FLAG_TRUNCATED
259− next= ff_mpeg1_find_frame_end(pc, buf, buf_size, s);
260−#else
261257 next = mpeg1_find_frame_end(pc, buf, buf_size, s);
262−#endif
263258
264259 if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
265260 *poutbuf = NULL;
libavcodec/options_table.h+0−3
@@ -64,9 +64,6 @@ static const AVOption avcodec_options[] = { · 63 unmodified lines
6464 {"pass2", "use internal 2-pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"},
6565 {"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"},
6666 {"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"},
67−#if FF_API_FLAG_TRUNCATED
68−{"truncated", "(Deprecated, use parsers instead.) Input bitstream might be randomly truncated", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, V|D | AV_OPT_FLAG_DEPRECATED, "flags"},
69−#endif
7067 {"ildct", "use interlaced DCT", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"},
7168 {"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"},
7269 {"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"},
libavcodec/pthread.c+0−3
@@ -48,9 +48,6 @@ · 47 unmodified lines
4848 static void validate_thread_parameters(AVCodecContext *avctx)
4949 {
5050 int frame_threading_supported = (avctx->codec->capabilities & AV_CODEC_CAP_FRAME_THREADS)
51−#if FF_API_FLAG_TRUNCATED
52− && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED)
53−#endif
5451 && !(avctx->flags & AV_CODEC_FLAG_LOW_DELAY)
5552 && !(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS);
5653 if (avctx->thread_count == 1) {
libavcodec/version_major.h+0−1
@@ -38,7 +38,6 @@ · 37 unmodified lines
3838 */
3939
4040 #define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
41−#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60)
4241 #define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60)
4342 #define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 60)
4443 #define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 60)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t