* [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS
@ 2022-09-20 16:42 Andreas Rheinhardt
2022-09-20 16:46 ` [FFmpeg-devel] [PATCH v2 2/4] avcodec/cbs: Only write extradata if there is something to write Andreas Rheinhardt
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Andreas Rheinhardt @ 2022-09-20 16:42 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
There is no check for whether these supposedly redundant PPS
are actually redundant. One could check via memcmp which would
work in practice* (because all content buffers are initially
zero-allocated), but this is not portable as compilers may
trash padding inside structures as they wish.
In case the PPS is not really redundant the output is garbage.
This happens with several files from the FATE-suite. E.g.
h264-conformance/CVCANLMA2_Sony_C.jsv doesn't decode correctly
any more, whereas h264-conformance/CABA3_TOSHIBA_E.264 even
fails in ff_cbs_write_packet(), because the inferred value
of num_ref_idx_l0_active_minus1 mismatches with the value set
in the slice (this happens when num_ref_idx_l0_default_active_minus1
changes in the PPS; the value in the slice header is inferred from
the original PPS's num_ref_idx_l0_default_active_minus1).
*: Unless slice_group_id is used, i.e. unless slice_group_map_type
is six.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h264_redundant_pps_bsf.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/libavcodec/h264_redundant_pps_bsf.c b/libavcodec/h264_redundant_pps_bsf.c
index f8bab1f109..df9a88a705 100644
--- a/libavcodec/h264_redundant_pps_bsf.c
+++ b/libavcodec/h264_redundant_pps_bsf.c
@@ -80,26 +80,15 @@ static int h264_redundant_pps_update_fragment(AVBSFContext *bsf,
CodedBitstreamFragment *au)
{
H264RedundantPPSContext *ctx = bsf->priv_data;
- int au_has_sps;
int err, i;
- au_has_sps = 0;
for (i = 0; i < au->nb_units; i++) {
CodedBitstreamUnit *nal = &au->units[i];
- if (nal->type == H264_NAL_SPS)
- au_has_sps = 1;
if (nal->type == H264_NAL_PPS) {
err = h264_redundant_pps_fixup_pps(ctx, nal);
if (err < 0)
return err;
- if (!au_has_sps) {
- av_log(bsf, AV_LOG_VERBOSE, "Deleting redundant PPS "
- "at %"PRId64".\n", pkt->pts);
- ff_cbs_delete_unit(au, i);
- i--;
- continue;
- }
}
if (nal->type == H264_NAL_SLICE ||
nal->type == H264_NAL_IDR_SLICE) {
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 6+ messages in thread
* [FFmpeg-devel] [PATCH v2 2/4] avcodec/cbs: Only write extradata if there is something to write
2022-09-20 16:42 [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS Andreas Rheinhardt
@ 2022-09-20 16:46 ` Andreas Rheinhardt
2022-09-20 16:46 ` [FFmpeg-devel] [PATCH v2 3/4] avformat/nutdec: Don't shrink packet size manually Andreas Rheinhardt
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Andreas Rheinhardt @ 2022-09-20 16:46 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is e.g. legal for an ISOBMFF avcc to contain zero parameter sets.
In this case the annex B that we produce would be empty and therefore
useless. This happens e.g. with mov/frag_overlap.mp4 from the
FATE-suite.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
Maybe check for the number of units to write instead?
libavcodec/cbs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c
index 07ae658a4c..8d6e3c3442 100644
--- a/libavcodec/cbs.c
+++ b/libavcodec/cbs.c
@@ -438,6 +438,10 @@ int ff_cbs_write_extradata(CodedBitstreamContext *ctx,
return err;
av_freep(&par->extradata);
+ par->extradata_size = 0;
+
+ if (!frag->data_size)
+ return 0;
par->extradata = av_malloc(frag->data_size +
AV_INPUT_BUFFER_PADDING_SIZE);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 6+ messages in thread
* [FFmpeg-devel] [PATCH v2 3/4] avformat/nutdec: Don't shrink packet size manually
2022-09-20 16:42 [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS Andreas Rheinhardt
2022-09-20 16:46 ` [FFmpeg-devel] [PATCH v2 2/4] avcodec/cbs: Only write extradata if there is something to write Andreas Rheinhardt
@ 2022-09-20 16:46 ` Andreas Rheinhardt
2022-09-20 16:46 ` [FFmpeg-devel] [PATCH v2 4/4] fate/cbs: Add tests for h264_redundant_pps BSF Andreas Rheinhardt
2022-09-22 15:29 ` [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS Andreas Rheinhardt
3 siblings, 0 replies; 6+ messages in thread
From: Andreas Rheinhardt @ 2022-09-20 16:46 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is unnecessary because an av_shrink_packet() a few lines below
will set the size; furthermore, it is actually harmful, because
av_shrink_packet() does nothing in case the size already matches,
so that the packet's padding is not correctly zeroed.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
I was about to make append_packet_chunked non-static, but then I noticed
that it unrefs the packet if the end size is zero (this might cause
problems for side-data only packets).
libavformat/nutdec.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 8cc56615ad..1d04f51d8d 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -1127,7 +1127,6 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
}
sm_size = avio_tell(bc) - pkt->pos;
size -= sm_size;
- pkt->size -= sm_size;
}
ret = avio_read(bc, pkt->data + nut->header_len[header_idx], size);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 6+ messages in thread
* [FFmpeg-devel] [PATCH v2 4/4] fate/cbs: Add tests for h264_redundant_pps BSF
2022-09-20 16:42 [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS Andreas Rheinhardt
2022-09-20 16:46 ` [FFmpeg-devel] [PATCH v2 2/4] avcodec/cbs: Only write extradata if there is something to write Andreas Rheinhardt
2022-09-20 16:46 ` [FFmpeg-devel] [PATCH v2 3/4] avformat/nutdec: Don't shrink packet size manually Andreas Rheinhardt
@ 2022-09-20 16:46 ` Andreas Rheinhardt
2022-09-22 15:29 ` [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS Andreas Rheinhardt
3 siblings, 0 replies; 6+ messages in thread
From: Andreas Rheinhardt @ 2022-09-20 16:46 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
This also tests writing slice data in the unaligned mode
(some of these files use CAVLC) as well as updating
side data as well as parsing ISOBMFF avcc extradata.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
I mistakenly sent only this commit earlier, but it is intended
to be applied on top of the other commits.
tests/fate/cbs.mak | 43 ++-
tests/ref/fate/h264_redundant_pps-annexb | 307 +++++++++++++++++++
tests/ref/fate/h264_redundant_pps-mov | 115 +++++++
tests/ref/fate/h264_redundant_pps-side_data | 21 ++
tests/ref/fate/h264_redundant_pps-side_data2 | 11 +
5 files changed, 494 insertions(+), 3 deletions(-)
create mode 100644 tests/ref/fate/h264_redundant_pps-annexb
create mode 100644 tests/ref/fate/h264_redundant_pps-mov
create mode 100644 tests/ref/fate/h264_redundant_pps-side_data
create mode 100644 tests/ref/fate/h264_redundant_pps-side_data2
diff --git a/tests/fate/cbs.mak b/tests/fate/cbs.mak
index 18efa96a61..a93e58ea9f 100644
--- a/tests/fate/cbs.mak
+++ b/tests/fate/cbs.mak
@@ -1,4 +1,4 @@
-# Read/write tests: this uses the codec metadata filter - with no
+# Read/write tests: By default, this uses the codec metadata filters - with no
# arguments, it decomposes the stream fully and then recomposes it
# without making any changes.
@@ -66,8 +66,45 @@ $(foreach N,$(FATE_CBS_H264_CONFORMANCE_SAMPLES),$(eval $(call FATE_CBS_TEST,h26
$(foreach N,$(FATE_CBS_H264_SAMPLES),$(eval $(call FATE_CBS_TEST,h264,$(basename $(N)),h264,h264/$(N),h264)))
FATE_CBS_H264-$(call FATE_CBS_DEPS, H264, H264, H264, H264, H264) = $(FATE_CBS_h264)
-FATE_SAMPLES_AVCONV += $(FATE_CBS_H264-yes)
-fate-cbs-h264: $(FATE_CBS_H264-yes)
+
+
+FATE_H264_REDUNDANT_PPS-$(call REMUX, H264, MOV_DEMUXER H264_REDUNDANT_PPS_BSF \
+ H264_DECODER H264_PARSER RAWVIDEO_ENCODER) \
+ += fate-h264_redundant_pps-mov
+fate-h264_redundant_pps-mov: CMD = transcode \
+ mov $(TARGET_SAMPLES)/mov/frag_overlap.mp4 h264 \
+ "-map 0:v -c copy -bsf h264_redundant_pps"
+
+# This file has changing pic_init_qp_minus26.
+FATE_H264_REDUNDANT_PPS-$(call REMUX, H264, H264_PARSER H264_REDUNDANT_PPS_BSF \
+ H264_DECODER RAWVIDEO_ENCODER) \
+ += fate-h264_redundant_pps-annexb
+fate-h264_redundant_pps-annexb: CMD = transcode \
+ h264 $(TARGET_SAMPLES)/h264-conformance/CABA3_TOSHIBA_E.264 \
+ h264 "-map 0:v -c copy -bsf h264_redundant_pps"
+
+# These two tests test that new extradata in packet side data is properly
+# modified by h264_redundant_pps. nut is used as destination container
+# because it can store extradata updates (in its experimental mode);
+# setting -syncpoints none is a hack to use nut version 4.
+FATE_H264_REDUNDANT_PPS-$(call REMUX, NUT, MOV_DEMUXER H264_REDUNDANT_PPS_BSF H264_DECODER) \
+ += fate-h264_redundant_pps-side_data
+fate-h264_redundant_pps-side_data: CMD = transcode \
+ mov $(TARGET_SAMPLES)/h264/thezerotheorem-cut.mp4 nut \
+ "-map 0:v -c copy -bsf h264_redundant_pps -syncpoints none -strict experimental" "-c copy"
+
+FATE_H264_REDUNDANT_PPS-$(call REMUX, NUT, MOV_DEMUXER H264_REDUNDANT_PPS_BSF \
+ H264_DECODER SCALE_FILTER RAWVIDEO_ENCODER) \
+ += fate-h264_redundant_pps-side_data2
+fate-h264_redundant_pps-side_data2: CMD = transcode \
+ mov $(TARGET_SAMPLES)/h264/extradata-reload-multi-stsd.mov nut \
+ "-map 0:v -c copy -bsf h264_redundant_pps -syncpoints none -strict experimental"
+
+fate-h264_redundant_pps: $(FATE_H264_REDUNDANT_PPS-yes)
+
+
+FATE_SAMPLES_FFMPEG += $(FATE_CBS_H264-yes) $(FATE_H264_REDUNDANT_PPS-yes)
+fate-cbs-h264: $(FATE_CBS_H264-yes) $(FATE_H264_REDUNDANT_PPS-yes)
# H.265 read/write
diff --git a/tests/ref/fate/h264_redundant_pps-annexb b/tests/ref/fate/h264_redundant_pps-annexb
new file mode 100644
index 0000000000..11d79f8b1f
--- /dev/null
+++ b/tests/ref/fate/h264_redundant_pps-annexb
@@ -0,0 +1,307 @@
+ce0890bd80342f8a3f6703f83b1c4959 *tests/data/fate/h264_redundant_pps-annexb.h264
+163967 tests/data/fate/h264_redundant_pps-annexb.h264
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 176x144
+#sar 0: 0/1
+0, 0, 0, 1, 38016, 0x72723ce4
+0, 1, 1, 1, 38016, 0x347219d7
+0, 2, 2, 1, 38016, 0x813ff182
+0, 3, 3, 1, 38016, 0x4e69d41a
+0, 4, 4, 1, 38016, 0x5e56acb6
+0, 5, 5, 1, 38016, 0xe72197e5
+0, 6, 6, 1, 38016, 0xd035807a
+0, 7, 7, 1, 38016, 0x9ee57559
+0, 8, 8, 1, 38016, 0xd0f56f28
+0, 9, 9, 1, 38016, 0xa5097788
+0, 10, 10, 1, 38016, 0xf108978d
+0, 11, 11, 1, 38016, 0xf76cb475
+0, 12, 12, 1, 38016, 0x0184cc3a
+0, 13, 13, 1, 38016, 0xa4b5dc15
+0, 14, 14, 1, 38016, 0x209cdc42
+0, 15, 15, 1, 38016, 0xd9e69a8c
+0, 16, 16, 1, 38016, 0xa2c3a9ba
+0, 17, 17, 1, 38016, 0xdf84a52e
+0, 18, 18, 1, 38016, 0xfe48a7f0
+0, 19, 19, 1, 38016, 0xb0279a19
+0, 20, 20, 1, 38016, 0xf3b48652
+0, 21, 21, 1, 38016, 0xc12b61b5
+0, 22, 22, 1, 38016, 0x13065a22
+0, 23, 23, 1, 38016, 0x804853d4
+0, 24, 24, 1, 38016, 0x40935736
+0, 25, 25, 1, 38016, 0x1a135ecb
+0, 26, 26, 1, 38016, 0x125f6116
+0, 27, 27, 1, 38016, 0x53286da3
+0, 28, 28, 1, 38016, 0xd49287ac
+0, 29, 29, 1, 38016, 0xc70a9c2c
+0, 30, 30, 1, 38016, 0x0c0c6998
+0, 31, 31, 1, 38016, 0xf37d9141
+0, 32, 32, 1, 38016, 0xd36eafa2
+0, 33, 33, 1, 38016, 0x0d1fc298
+0, 34, 34, 1, 38016, 0xf84ad5d9
+0, 35, 35, 1, 38016, 0xc1e8d93d
+0, 36, 36, 1, 38016, 0xe190dabd
+0, 37, 37, 1, 38016, 0x9542db28
+0, 38, 38, 1, 38016, 0xa67edc7f
+0, 39, 39, 1, 38016, 0x65efdfa7
+0, 40, 40, 1, 38016, 0x7039e6c6
+0, 41, 41, 1, 38016, 0x8307ee87
+0, 42, 42, 1, 38016, 0x1f83ec00
+0, 43, 43, 1, 38016, 0x9e33ea6e
+0, 44, 44, 1, 38016, 0xb53ef238
+0, 45, 45, 1, 38016, 0x6d04930c
+0, 46, 46, 1, 38016, 0xed90a50e
+0, 47, 47, 1, 38016, 0xd98cb4a6
+0, 48, 48, 1, 38016, 0xa7f5bd5e
+0, 49, 49, 1, 38016, 0x4df9ca95
+0, 50, 50, 1, 38016, 0xc8e7cb40
+0, 51, 51, 1, 38016, 0x93d9d23c
+0, 52, 52, 1, 38016, 0xc07fd34f
+0, 53, 53, 1, 38016, 0xf7c5d645
+0, 54, 54, 1, 38016, 0x3c1ddf53
+0, 55, 55, 1, 38016, 0x0bafe394
+0, 56, 56, 1, 38016, 0x9179ec6f
+0, 57, 57, 1, 38016, 0x3483efc3
+0, 58, 58, 1, 38016, 0xf7ccf70d
+0, 59, 59, 1, 38016, 0x289ef13b
+0, 60, 60, 1, 38016, 0xb00c99dc
+0, 61, 61, 1, 38016, 0x59409b34
+0, 62, 62, 1, 38016, 0x3fc079a2
+0, 63, 63, 1, 38016, 0x90ad49d9
+0, 64, 64, 1, 38016, 0x8e7751e2
+0, 65, 65, 1, 38016, 0xed20743d
+0, 66, 66, 1, 38016, 0x66a1a470
+0, 67, 67, 1, 38016, 0x7a77e252
+0, 68, 68, 1, 38016, 0x6bb427fe
+0, 69, 69, 1, 38016, 0x87126360
+0, 70, 70, 1, 38016, 0x330789d0
+0, 71, 71, 1, 38016, 0xc298b987
+0, 72, 72, 1, 38016, 0x4959f143
+0, 73, 73, 1, 38016, 0xa66e3082
+0, 74, 74, 1, 38016, 0xb9f67824
+0, 75, 75, 1, 38016, 0x27fe46a2
+0, 76, 76, 1, 38016, 0xc50c87ed
+0, 77, 77, 1, 38016, 0x9523a9f6
+0, 78, 78, 1, 38016, 0xbe28d1d7
+0, 79, 79, 1, 38016, 0x3c0ee964
+0, 80, 80, 1, 38016, 0x65c7f36c
+0, 81, 81, 1, 38016, 0xe5030946
+0, 82, 82, 1, 38016, 0x4bbb11fa
+0, 83, 83, 1, 38016, 0xeaf209ed
+0, 84, 84, 1, 38016, 0x96c80987
+0, 85, 85, 1, 38016, 0x69820c58
+0, 86, 86, 1, 38016, 0x5f951aa7
+0, 87, 87, 1, 38016, 0xfe6122d9
+0, 88, 88, 1, 38016, 0xa202301a
+0, 89, 89, 1, 38016, 0xdd2628fb
+0, 90, 90, 1, 38016, 0xe081a5ff
+0, 91, 91, 1, 38016, 0x5b858e9e
+0, 92, 92, 1, 38016, 0x7a368229
+0, 93, 93, 1, 38016, 0x3791829a
+0, 94, 94, 1, 38016, 0x9c68723d
+0, 95, 95, 1, 38016, 0xef26778e
+0, 96, 96, 1, 38016, 0x39a491cf
+0, 97, 97, 1, 38016, 0x776ea867
+0, 98, 98, 1, 38016, 0xda9ac03b
+0, 99, 99, 1, 38016, 0x653bc9a3
+0, 100, 100, 1, 38016, 0x79e1da19
+0, 101, 101, 1, 38016, 0x3b98c6eb
+0, 102, 102, 1, 38016, 0x42cdb846
+0, 103, 103, 1, 38016, 0x7872ada1
+0, 104, 104, 1, 38016, 0xb2f6d2ef
+0, 105, 105, 1, 38016, 0x9468b16a
+0, 106, 106, 1, 38016, 0xe793c91a
+0, 107, 107, 1, 38016, 0x80bde366
+0, 108, 108, 1, 38016, 0xa7250446
+0, 109, 109, 1, 38016, 0x7039280b
+0, 110, 110, 1, 38016, 0x1665350c
+0, 111, 111, 1, 38016, 0xb5c93f1f
+0, 112, 112, 1, 38016, 0xf77a4c44
+0, 113, 113, 1, 38016, 0x3a093143
+0, 114, 114, 1, 38016, 0x1d6b1005
+0, 115, 115, 1, 38016, 0xe1a10c01
+0, 116, 116, 1, 38016, 0x2d4d1d54
+0, 117, 117, 1, 38016, 0x902f2b14
+0, 118, 118, 1, 38016, 0xb26e3e73
+0, 119, 119, 1, 38016, 0xed7a469e
+0, 120, 120, 1, 38016, 0xbc663d2a
+0, 121, 121, 1, 38016, 0x60a5488e
+0, 122, 122, 1, 38016, 0x451b31ca
+0, 123, 123, 1, 38016, 0x54311166
+0, 124, 124, 1, 38016, 0x57d9f31e
+0, 125, 125, 1, 38016, 0x567dd693
+0, 126, 126, 1, 38016, 0x0e58d88c
+0, 127, 127, 1, 38016, 0xa555e124
+0, 128, 128, 1, 38016, 0x94e2f835
+0, 129, 129, 1, 38016, 0xe49e0ec0
+0, 130, 130, 1, 38016, 0x585d188e
+0, 131, 131, 1, 38016, 0x696e1a0d
+0, 132, 132, 1, 38016, 0xac9014b1
+0, 133, 133, 1, 38016, 0x915413c6
+0, 134, 134, 1, 38016, 0x5fa30be7
+0, 135, 135, 1, 38016, 0x8fbfb69c
+0, 136, 136, 1, 38016, 0xcaeabfab
+0, 137, 137, 1, 38016, 0xe494bf5c
+0, 138, 138, 1, 38016, 0xae03be55
+0, 139, 139, 1, 38016, 0xb734b4d3
+0, 140, 140, 1, 38016, 0xdc6fb56f
+0, 141, 141, 1, 38016, 0xfea0a853
+0, 142, 142, 1, 38016, 0xb4919381
+0, 143, 143, 1, 38016, 0x13a792fe
+0, 144, 144, 1, 38016, 0xc8829fd8
+0, 145, 145, 1, 38016, 0x2113a62b
+0, 146, 146, 1, 38016, 0x171f98d2
+0, 147, 147, 1, 38016, 0x1a6d6d17
+0, 148, 148, 1, 38016, 0xd4ab41c3
+0, 149, 149, 1, 38016, 0xd2df1c80
+0, 150, 150, 1, 38016, 0x14cdbb35
+0, 151, 151, 1, 38016, 0x2b74b829
+0, 152, 152, 1, 38016, 0x6433bd55
+0, 153, 153, 1, 38016, 0xd11dbc28
+0, 154, 154, 1, 38016, 0x4981ad33
+0, 155, 155, 1, 38016, 0xc38bbbad
+0, 156, 156, 1, 38016, 0x048de367
+0, 157, 157, 1, 38016, 0x6c9a0c5a
+0, 158, 158, 1, 38016, 0x384c4255
+0, 159, 159, 1, 38016, 0x3e9873ba
+0, 160, 160, 1, 38016, 0xe4988671
+0, 161, 161, 1, 38016, 0x05b4843c
+0, 162, 162, 1, 38016, 0xed0a7e13
+0, 163, 163, 1, 38016, 0x750c6f90
+0, 164, 164, 1, 38016, 0x9d296035
+0, 165, 165, 1, 38016, 0xbaa006bd
+0, 166, 166, 1, 38016, 0x8289f8ae
+0, 167, 167, 1, 38016, 0x3f3de147
+0, 168, 168, 1, 38016, 0xc5debc49
+0, 169, 169, 1, 38016, 0x1fe9bbfc
+0, 170, 170, 1, 38016, 0x006cd4a9
+0, 171, 171, 1, 38016, 0xe551f2b3
+0, 172, 172, 1, 38016, 0xb370140e
+0, 173, 173, 1, 38016, 0xc9441c24
+0, 174, 174, 1, 38016, 0x7f5c01c5
+0, 175, 175, 1, 38016, 0x352ad9f6
+0, 176, 176, 1, 38016, 0xe0909a17
+0, 177, 177, 1, 38016, 0x49bf5ea8
+0, 178, 178, 1, 38016, 0x7f1d387b
+0, 179, 179, 1, 38016, 0x30812233
+0, 180, 180, 1, 38016, 0xb0bdf16f
+0, 181, 181, 1, 38016, 0x5372d0e9
+0, 182, 182, 1, 38016, 0xbf1bc91c
+0, 183, 183, 1, 38016, 0xaef5d647
+0, 184, 184, 1, 38016, 0xf007e86c
+0, 185, 185, 1, 38016, 0x683bf72b
+0, 186, 186, 1, 38016, 0xbb722114
+0, 187, 187, 1, 38016, 0xc5864b63
+0, 188, 188, 1, 38016, 0xfefd5cf4
+0, 189, 189, 1, 38016, 0xa0f263d5
+0, 190, 190, 1, 38016, 0x18401a02
+0, 191, 191, 1, 38016, 0x55cdd97b
+0, 192, 192, 1, 38016, 0x5a4ee22d
+0, 193, 193, 1, 38016, 0xa60706b3
+0, 194, 194, 1, 38016, 0x644422bb
+0, 195, 195, 1, 38016, 0xc22421c9
+0, 196, 196, 1, 38016, 0x1d6b54e4
+0, 197, 197, 1, 38016, 0xc7627820
+0, 198, 198, 1, 38016, 0x0a6ea609
+0, 199, 199, 1, 38016, 0x4315c087
+0, 200, 200, 1, 38016, 0x3164d978
+0, 201, 201, 1, 38016, 0x08e3e7eb
+0, 202, 202, 1, 38016, 0x4f04eaed
+0, 203, 203, 1, 38016, 0x9f83eb5a
+0, 204, 204, 1, 38016, 0xfbbcf0b2
+0, 205, 205, 1, 38016, 0xee1efb8a
+0, 206, 206, 1, 38016, 0x87710ba0
+0, 207, 207, 1, 38016, 0xb96b05c1
+0, 208, 208, 1, 38016, 0xd5a4fc50
+0, 209, 209, 1, 38016, 0xad85ea19
+0, 210, 210, 1, 38016, 0x5f606058
+0, 211, 211, 1, 38016, 0xdaf55ad0
+0, 212, 212, 1, 38016, 0xee8564d6
+0, 213, 213, 1, 38016, 0xa1846cad
+0, 214, 214, 1, 38016, 0xcd316a62
+0, 215, 215, 1, 38016, 0xdcf5638f
+0, 216, 216, 1, 38016, 0xc5e36d1d
+0, 217, 217, 1, 38016, 0x958369a6
+0, 218, 218, 1, 38016, 0x05826bf0
+0, 219, 219, 1, 38016, 0x22146914
+0, 220, 220, 1, 38016, 0xf5086111
+0, 221, 221, 1, 38016, 0x88f35468
+0, 222, 222, 1, 38016, 0x3ae94126
+0, 223, 223, 1, 38016, 0xf4473aa8
+0, 224, 224, 1, 38016, 0x430c3da2
+0, 225, 225, 1, 38016, 0xaf95113e
+0, 226, 226, 1, 38016, 0xa8a216d6
+0, 227, 227, 1, 38016, 0xad2f328c
+0, 228, 228, 1, 38016, 0xea724415
+0, 229, 229, 1, 38016, 0x34016af4
+0, 230, 230, 1, 38016, 0x4829a4cb
+0, 231, 231, 1, 38016, 0x4b24bc67
+0, 232, 232, 1, 38016, 0xb523f023
+0, 233, 233, 1, 38016, 0x5c6d2305
+0, 234, 234, 1, 38016, 0x39e63adc
+0, 235, 235, 1, 38016, 0xf7c64a7c
+0, 236, 236, 1, 38016, 0xd601680a
+0, 237, 237, 1, 38016, 0xbbad6a12
+0, 238, 238, 1, 38016, 0xddc1500f
+0, 239, 239, 1, 38016, 0x1f1726e6
+0, 240, 240, 1, 38016, 0x48aee68f
+0, 241, 241, 1, 38016, 0xc1fbd4f0
+0, 242, 242, 1, 38016, 0x4a89dc83
+0, 243, 243, 1, 38016, 0xa7cd2b02
+0, 244, 244, 1, 38016, 0xf52aa0b8
+0, 245, 245, 1, 38016, 0x1f260626
+0, 246, 246, 1, 38016, 0x80561eac
+0, 247, 247, 1, 38016, 0x6687f8ef
+0, 248, 248, 1, 38016, 0x986ab08f
+0, 249, 249, 1, 38016, 0xb4923773
+0, 250, 250, 1, 38016, 0x5cc2d603
+0, 251, 251, 1, 38016, 0x9e8d93db
+0, 252, 252, 1, 38016, 0x33fd8981
+0, 253, 253, 1, 38016, 0xaf45e630
+0, 254, 254, 1, 38016, 0x1227448e
+0, 255, 255, 1, 38016, 0x424cccf0
+0, 256, 256, 1, 38016, 0x03b0cb3e
+0, 257, 257, 1, 38016, 0x7aad547d
+0, 258, 258, 1, 38016, 0xbf8544b2
+0, 259, 259, 1, 38016, 0x54a843ca
+0, 260, 260, 1, 38016, 0x759d4dd0
+0, 261, 261, 1, 38016, 0x000162da
+0, 262, 262, 1, 38016, 0x87ec74b0
+0, 263, 263, 1, 38016, 0xefee8259
+0, 264, 264, 1, 38016, 0x7b547eea
+0, 265, 265, 1, 38016, 0xcae96b73
+0, 266, 266, 1, 38016, 0x730f59c3
+0, 267, 267, 1, 38016, 0x7d9b3e82
+0, 268, 268, 1, 38016, 0x3bb11ef0
+0, 269, 269, 1, 38016, 0x7581fa6b
+0, 270, 270, 1, 38016, 0xe594a982
+0, 271, 271, 1, 38016, 0xde3888d6
+0, 272, 272, 1, 38016, 0x0e096d6b
+0, 273, 273, 1, 38016, 0x297c20dc
+0, 274, 274, 1, 38016, 0x51f7ce7f
+0, 275, 275, 1, 38016, 0x23d2c247
+0, 276, 276, 1, 38016, 0x0bdcd0d0
+0, 277, 277, 1, 38016, 0x63cfd4f3
+0, 278, 278, 1, 38016, 0x6d4b01f8
+0, 279, 279, 1, 38016, 0xa50d72f0
+0, 280, 280, 1, 38016, 0xccad0d72
+0, 281, 281, 1, 38016, 0x10c9e33e
+0, 282, 282, 1, 38016, 0xba6daf97
+0, 283, 283, 1, 38016, 0xd65074e0
+0, 284, 284, 1, 38016, 0xd36954aa
+0, 285, 285, 1, 38016, 0xd9a2a642
+0, 286, 286, 1, 38016, 0xce755f9f
+0, 287, 287, 1, 38016, 0x81d29c44
+0, 288, 288, 1, 38016, 0x23b0aef5
+0, 289, 289, 1, 38016, 0xb0ef9efa
+0, 290, 290, 1, 38016, 0xf20d4a7a
+0, 291, 291, 1, 38016, 0xa0c86899
+0, 292, 292, 1, 38016, 0x1ae4f865
+0, 293, 293, 1, 38016, 0x3a5731c8
+0, 294, 294, 1, 38016, 0x75f17ec5
+0, 295, 295, 1, 38016, 0x8f447aa9
+0, 296, 296, 1, 38016, 0x71615441
+0, 297, 297, 1, 38016, 0x90c13e26
+0, 298, 298, 1, 38016, 0x08d04aaf
+0, 299, 299, 1, 38016, 0x14fd7b04
diff --git a/tests/ref/fate/h264_redundant_pps-mov b/tests/ref/fate/h264_redundant_pps-mov
new file mode 100644
index 0000000000..7cab0e0b29
--- /dev/null
+++ b/tests/ref/fate/h264_redundant_pps-mov
@@ -0,0 +1,115 @@
+ac2e8f528dae4e4d610fa3517d2c94fb *tests/data/fate/h264_redundant_pps-mov.h264
+187284 tests/data/fate/h264_redundant_pps-mov.h264
+#tb 0: 1/24
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 640x360
+#sar 0: 1/1
+0, 0, 0, 1, 345600, 0xc40ffa02
+0, 1, 1, 1, 345600, 0x346acaba
+0, 2, 2, 1, 345600, 0x26f3de5d
+0, 3, 3, 1, 345600, 0xacf384e1
+0, 4, 4, 1, 345600, 0xd7dc8e0b
+0, 5, 5, 1, 345600, 0xd7dc8e0b
+0, 6, 6, 1, 345600, 0x47f99430
+0, 7, 7, 1, 345600, 0x00259c5a
+0, 8, 8, 1, 345600, 0xec659aa2
+0, 9, 9, 1, 345600, 0xec659aa2
+0, 10, 10, 1, 345600, 0x84fef765
+0, 11, 11, 1, 345600, 0xcbeecbe4
+0, 12, 12, 1, 345600, 0x9386982e
+0, 13, 13, 1, 345600, 0x682ccf66
+0, 14, 14, 1, 345600, 0x89d10278
+0, 15, 15, 1, 345600, 0x407272a3
+0, 16, 16, 1, 345600, 0x32e0b287
+0, 17, 17, 1, 345600, 0x709ccfe5
+0, 18, 18, 1, 345600, 0x00dcbebc
+0, 19, 19, 1, 345600, 0x61b7aa83
+0, 20, 20, 1, 345600, 0x03c7c404
+0, 21, 21, 1, 345600, 0x9b794d4c
+0, 22, 22, 1, 345600, 0xb090b3f0
+0, 23, 23, 1, 345600, 0xdb596340
+0, 24, 24, 1, 345600, 0x031f4ba8
+0, 25, 25, 1, 345600, 0xef484d42
+0, 26, 26, 1, 345600, 0xa2814cec
+0, 27, 27, 1, 345600, 0x5432765c
+0, 28, 28, 1, 345600, 0xef5fd507
+0, 29, 29, 1, 345600, 0x13b2138d
+0, 30, 30, 1, 345600, 0x29f24795
+0, 31, 31, 1, 345600, 0x6dce96e1
+0, 32, 32, 1, 345600, 0xb0cdf793
+0, 33, 33, 1, 345600, 0x1b921fb6
+0, 34, 34, 1, 345600, 0xcc446384
+0, 35, 35, 1, 345600, 0x784689e7
+0, 36, 36, 1, 345600, 0xfaf5ac7e
+0, 37, 37, 1, 345600, 0x6ce2c6b5
+0, 38, 38, 1, 345600, 0xcb9408ad
+0, 39, 39, 1, 345600, 0x4f40082d
+0, 40, 40, 1, 345600, 0x9c039eb7
+0, 41, 41, 1, 345600, 0xb271ec7d
+0, 42, 42, 1, 345600, 0x31d2af2c
+0, 43, 43, 1, 345600, 0xe187adc4
+0, 44, 44, 1, 345600, 0xec28b3cc
+0, 45, 45, 1, 345600, 0x5596b34c
+0, 46, 46, 1, 345600, 0xb75f475c
+0, 47, 47, 1, 345600, 0x888f311c
+0, 48, 48, 1, 345600, 0xedab720f
+0, 49, 49, 1, 345600, 0xbf75fa40
+0, 50, 50, 1, 345600, 0x13bb37d7
+0, 51, 51, 1, 345600, 0xbc6aeded
+0, 52, 52, 1, 345600, 0xf6a6478a
+0, 53, 53, 1, 345600, 0x46d4e723
+0, 54, 54, 1, 345600, 0x1263e5e3
+0, 55, 55, 1, 345600, 0x6d3fc449
+0, 56, 56, 1, 345600, 0xc218c2c9
+0, 57, 57, 1, 345600, 0x12ef8744
+0, 58, 58, 1, 345600, 0xc073486e
+0, 59, 59, 1, 345600, 0xa3403147
+0, 60, 60, 1, 345600, 0x720a8c5b
+0, 61, 61, 1, 345600, 0x7a268f12
+0, 62, 62, 1, 345600, 0xf311d147
+0, 63, 63, 1, 345600, 0x5cc12e78
+0, 64, 64, 1, 345600, 0xf09ecd59
+0, 65, 65, 1, 345600, 0x0e3b46c3
+0, 66, 66, 1, 345600, 0x80786a01
+0, 67, 67, 1, 345600, 0x3edd6931
+0, 68, 68, 1, 345600, 0x14e27291
+0, 69, 69, 1, 345600, 0x12776fd1
+0, 70, 70, 1, 345600, 0xa68cf46d
+0, 71, 71, 1, 345600, 0x04f99d27
+0, 72, 72, 1, 345600, 0x76618a97
+0, 73, 73, 1, 345600, 0x7559dcae
+0, 74, 74, 1, 345600, 0xc9f4d77f
+0, 75, 75, 1, 345600, 0xe76fbad7
+0, 76, 76, 1, 345600, 0x6efca571
+0, 77, 77, 1, 345600, 0x0619a437
+0, 78, 78, 1, 345600, 0x0b48a563
+0, 79, 79, 1, 345600, 0x6ec1bae9
+0, 80, 80, 1, 345600, 0xcce588aa
+0, 81, 81, 1, 345600, 0xa003e269
+0, 82, 82, 1, 345600, 0x6507ec83
+0, 83, 83, 1, 345600, 0xa697ec03
+0, 84, 84, 1, 345600, 0xb18a0ddd
+0, 85, 85, 1, 345600, 0x96b74d36
+0, 86, 86, 1, 345600, 0x6b6d5ebb
+0, 87, 87, 1, 345600, 0x86a082c4
+0, 88, 88, 1, 345600, 0x463ac3e6
+0, 89, 89, 1, 345600, 0xac54e07e
+0, 90, 90, 1, 345600, 0xdd32e5ce
+0, 91, 91, 1, 345600, 0xc27b9140
+0, 92, 92, 1, 345600, 0x70855f0b
+0, 93, 93, 1, 345600, 0xad849d48
+0, 94, 94, 1, 345600, 0x26f6bbba
+0, 95, 95, 1, 345600, 0x4c01cc6c
+0, 96, 96, 1, 345600, 0x2f6fdac5
+0, 97, 97, 1, 345600, 0xb4d8f6d6
+0, 98, 98, 1, 345600, 0x53aafc9f
+0, 99, 99, 1, 345600, 0x53aafc9f
+0, 100, 100, 1, 345600, 0xa016f90b
+0, 101, 101, 1, 345600, 0x7a68ea8b
+0, 102, 102, 1, 345600, 0x74cee980
+0, 103, 103, 1, 345600, 0x16621888
+0, 104, 104, 1, 345600, 0x16621888
+0, 105, 105, 1, 345600, 0x4f6c5227
+0, 106, 106, 1, 345600, 0x5d8343c2
+0, 107, 107, 1, 345600, 0x4ea83d1a
diff --git a/tests/ref/fate/h264_redundant_pps-side_data b/tests/ref/fate/h264_redundant_pps-side_data
new file mode 100644
index 0000000000..c1c00eebae
--- /dev/null
+++ b/tests/ref/fate/h264_redundant_pps-side_data
@@ -0,0 +1,21 @@
+a35cca13c3f91d1a279bf576b8264d05 *tests/data/fate/h264_redundant_pps-side_data.nut
+596153 tests/data/fate/h264_redundant_pps-side_data.nut
+#extradata 0: 34, 0x851f08e4
+#tb 0: 1/48000
+#media_type 0: video
+#codec_id 0: h264
+#dimensions 0: 1920x1080
+#sar 0: 0/1
+0, -2002, 0, 2002, 247959, 0xdb721881, S=1, 34
+0, 0, 4004, 2002, 43356, 0xa366eb79, F=0x0
+0, 2002, 2002, 2002, 11423, 0x9c0a86fa, F=0x0
+0, 4004, 8008, 2002, 50801, 0xfbfe860d, F=0x0
+0, 6006, 6006, 2002, 12567, 0x650a5321, F=0x0
+0, 8008, 12012, 2002, 52447, 0x19e106c1, F=0x0
+0, 10010, 10010, 2002, 12575, 0x83c94868, F=0x0
+0, 12012, 16016, 2002, 54028, 0xa8460c03, F=0x0
+0, 14014, 14014, 2002, 13539, 0x0bc96c74, F=0x0
+0, 16016, 20020, 2002, 54489, 0x319c9032, F=0x0
+0, 18018, 18018, 2002, 13705, 0x38a02805, F=0x0
+0, 20020, 22022, 2002, 22313, 0xec81a420, F=0x0
+0, 22022, 24024, 2002, 6335, 0xa524214d
diff --git a/tests/ref/fate/h264_redundant_pps-side_data2 b/tests/ref/fate/h264_redundant_pps-side_data2
new file mode 100644
index 0000000000..7484fbeb07
--- /dev/null
+++ b/tests/ref/fate/h264_redundant_pps-side_data2
@@ -0,0 +1,11 @@
+dd953f8d95d2927703ce9593a07fe2e7 *tests/data/fate/h264_redundant_pps-side_data2.nut
+5162 tests/data/fate/h264_redundant_pps-side_data2.nut
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 256x128
+#sar 0: 1/1
+0, 0, 0, 1, 49152, 0x08745db9
+0, 1, 1, 1, 49152, 0x96bf5e58
+0, 2, 2, 1, 49152, 0x8fe31b6d
+0, 3, 3, 1, 49152, 0x0b621cc3
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS
2022-09-20 16:42 [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS Andreas Rheinhardt
` (2 preceding siblings ...)
2022-09-20 16:46 ` [FFmpeg-devel] [PATCH v2 4/4] fate/cbs: Add tests for h264_redundant_pps BSF Andreas Rheinhardt
@ 2022-09-22 15:29 ` Andreas Rheinhardt
2022-09-24 14:11 ` Andreas Rheinhardt
3 siblings, 1 reply; 6+ messages in thread
From: Andreas Rheinhardt @ 2022-09-22 15:29 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> There is no check for whether these supposedly redundant PPS
> are actually redundant. One could check via memcmp which would
> work in practice* (because all content buffers are initially
> zero-allocated), but this is not portable as compilers may
> trash padding inside structures as they wish.
>
> In case the PPS is not really redundant the output is garbage.
> This happens with several files from the FATE-suite. E.g.
> h264-conformance/CVCANLMA2_Sony_C.jsv doesn't decode correctly
> any more, whereas h264-conformance/CABA3_TOSHIBA_E.264 even
> fails in ff_cbs_write_packet(), because the inferred value
> of num_ref_idx_l0_active_minus1 mismatches with the value set
> in the slice (this happens when num_ref_idx_l0_default_active_minus1
> changes in the PPS; the value in the slice header is inferred from
> the original PPS's num_ref_idx_l0_default_active_minus1).
>
> *: Unless slice_group_id is used, i.e. unless slice_group_map_type
> is six.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/h264_redundant_pps_bsf.c | 11 -----------
> 1 file changed, 11 deletions(-)
>
> diff --git a/libavcodec/h264_redundant_pps_bsf.c b/libavcodec/h264_redundant_pps_bsf.c
> index f8bab1f109..df9a88a705 100644
> --- a/libavcodec/h264_redundant_pps_bsf.c
> +++ b/libavcodec/h264_redundant_pps_bsf.c
> @@ -80,26 +80,15 @@ static int h264_redundant_pps_update_fragment(AVBSFContext *bsf,
> CodedBitstreamFragment *au)
> {
> H264RedundantPPSContext *ctx = bsf->priv_data;
> - int au_has_sps;
> int err, i;
>
> - au_has_sps = 0;
> for (i = 0; i < au->nb_units; i++) {
> CodedBitstreamUnit *nal = &au->units[i];
>
> - if (nal->type == H264_NAL_SPS)
> - au_has_sps = 1;
> if (nal->type == H264_NAL_PPS) {
> err = h264_redundant_pps_fixup_pps(ctx, nal);
> if (err < 0)
> return err;
> - if (!au_has_sps) {
> - av_log(bsf, AV_LOG_VERBOSE, "Deleting redundant PPS "
> - "at %"PRId64".\n", pkt->pts);
> - ff_cbs_delete_unit(au, i);
> - i--;
> - continue;
> - }
> }
> if (nal->type == H264_NAL_SLICE ||
> nal->type == H264_NAL_IDR_SLICE) {
I just noticed that the documentation contains the sentence "A new
single global PPS is created, and all of the redundant PPSs within the
stream are removed". As the observations in the commit message show,
this is just not true because every PPS in an access unit without SPS is
considered redundant, making this filter dangerous. So I would simply
delete this sentence from the documentation. Is everyone ok with this?
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS
2022-09-22 15:29 ` [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS Andreas Rheinhardt
@ 2022-09-24 14:11 ` Andreas Rheinhardt
0 siblings, 0 replies; 6+ messages in thread
From: Andreas Rheinhardt @ 2022-09-24 14:11 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> Andreas Rheinhardt:
>> There is no check for whether these supposedly redundant PPS
>> are actually redundant. One could check via memcmp which would
>> work in practice* (because all content buffers are initially
>> zero-allocated), but this is not portable as compilers may
>> trash padding inside structures as they wish.
>>
>> In case the PPS is not really redundant the output is garbage.
>> This happens with several files from the FATE-suite. E.g.
>> h264-conformance/CVCANLMA2_Sony_C.jsv doesn't decode correctly
>> any more, whereas h264-conformance/CABA3_TOSHIBA_E.264 even
>> fails in ff_cbs_write_packet(), because the inferred value
>> of num_ref_idx_l0_active_minus1 mismatches with the value set
>> in the slice (this happens when num_ref_idx_l0_default_active_minus1
>> changes in the PPS; the value in the slice header is inferred from
>> the original PPS's num_ref_idx_l0_default_active_minus1).
>>
>> *: Unless slice_group_id is used, i.e. unless slice_group_map_type
>> is six.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>> libavcodec/h264_redundant_pps_bsf.c | 11 -----------
>> 1 file changed, 11 deletions(-)
>>
>> diff --git a/libavcodec/h264_redundant_pps_bsf.c b/libavcodec/h264_redundant_pps_bsf.c
>> index f8bab1f109..df9a88a705 100644
>> --- a/libavcodec/h264_redundant_pps_bsf.c
>> +++ b/libavcodec/h264_redundant_pps_bsf.c
>> @@ -80,26 +80,15 @@ static int h264_redundant_pps_update_fragment(AVBSFContext *bsf,
>> CodedBitstreamFragment *au)
>> {
>> H264RedundantPPSContext *ctx = bsf->priv_data;
>> - int au_has_sps;
>> int err, i;
>>
>> - au_has_sps = 0;
>> for (i = 0; i < au->nb_units; i++) {
>> CodedBitstreamUnit *nal = &au->units[i];
>>
>> - if (nal->type == H264_NAL_SPS)
>> - au_has_sps = 1;
>> if (nal->type == H264_NAL_PPS) {
>> err = h264_redundant_pps_fixup_pps(ctx, nal);
>> if (err < 0)
>> return err;
>> - if (!au_has_sps) {
>> - av_log(bsf, AV_LOG_VERBOSE, "Deleting redundant PPS "
>> - "at %"PRId64".\n", pkt->pts);
>> - ff_cbs_delete_unit(au, i);
>> - i--;
>> - continue;
>> - }
>> }
>> if (nal->type == H264_NAL_SLICE ||
>> nal->type == H264_NAL_IDR_SLICE) {
>
> I just noticed that the documentation contains the sentence "A new
> single global PPS is created, and all of the redundant PPSs within the
> stream are removed". As the observations in the commit message show,
> this is just not true because every PPS in an access unit without SPS is
> considered redundant, making this filter dangerous. So I would simply
> delete this sentence from the documentation. Is everyone ok with this?
>
Will apply this patchset tomorrow unless there are objections.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-09-24 14:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-20 16:42 [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS Andreas Rheinhardt
2022-09-20 16:46 ` [FFmpeg-devel] [PATCH v2 2/4] avcodec/cbs: Only write extradata if there is something to write Andreas Rheinhardt
2022-09-20 16:46 ` [FFmpeg-devel] [PATCH v2 3/4] avformat/nutdec: Don't shrink packet size manually Andreas Rheinhardt
2022-09-20 16:46 ` [FFmpeg-devel] [PATCH v2 4/4] fate/cbs: Add tests for h264_redundant_pps BSF Andreas Rheinhardt
2022-09-22 15:29 ` [FFmpeg-devel] [PATCH v2 1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS Andreas Rheinhardt
2022-09-24 14:11 ` Andreas Rheinhardt
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git