[FFmpeg-devel] linker error

2022-10-19 Thread Helmut K. C. Tessarek
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

I compile the static ffmpeg binaries for macOS and I have noticed just now
the following error:

duplicate symbol '_read_file' in:
fftools/ffmpeg_opt.o
/Users/Shared/ffmpeg/sw/lib/libass.a(ass.o)
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation
)
make: *** [ffmpeg_g] Error 1

I believe it has something to do with commit
18d6c07267994398f99b2241f577f8e7118af099
fftools/ffmpeg_opt: move opening output files into a new file

Cheers,
  K. C.

- -- 
regards Helmut K. C. Tessarek  KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEE191csiqpm8f5Ln9WvgmFNJ1E3QAFAmNQz30ACgkQvgmFNJ1E
3QBXaQ//cihF3S1R5ruPOgOr7eR+sCdo1uoJEncezKJmoF/3IrsEgB05YHiU4nSz
H9Qwm1eE8QNDBoYZNZ9gc/bRB7S4u+kUPKAQiE3ZyfYteK2Ez/zy9v/OCXX639pv
cuCinQGmIcBAMnHo9Ue3v+E2T89x/fzGyew+3jbfkiG9Gl2aTV/u1k+x/IRzfRCE
HuooGGaZUpQhQ0us46CfEHUjHte3QWCDUxKy9tkowVVFgHSyBZMcWfJb7VyN9rSJ
CDh0uImRkJ6tR5NtpcpDEG+AJ5HK+olMEaZHEZ8WrlJOrC6AGK1d5N/tGaRfIxiO
7h9K9Disu/HEoGPcA0ULGlkN1axCLPJL0mEKRJVQBEe9Nh7OGFceA3uf/2a0TaBU
bevCijy0gNHJi9BNPjK8+vvIgMhsfbkCqmnOKqnntHhUEyEfgm5CT7oBwC8DNZFO
aXempSZAqUnCECv/Ry8GU66C/x97FQgvHTYFMrb5gfdAk7mSMu5vge0hkzqM
IC7b3MNzSkjEOj4/cZCpzayZjqf2PJ3OIzaZ2na8jT7x7gm4neY9GvIzyF72xoka
4woquOWq3n4F2KpFK4Y5wBxlJYVd1slf7jf5A+r5MVNl+pfiJ2UfVGbgcBdUgH/J
JnHAjO+nCQ8NAJGZ/jgRL3vy6BoG03u3WmfdjVqzUMBFuwvxEHE=
=CZog
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avformat/hls: fix spelling and grammar on wrap warning

2022-10-19 Thread Gyan Doshi



On 2022-10-19 08:33 pm, Tristan Matthews wrote:

On Fri, Oct 7, 2022 at 1:41 AM Gyan Doshi  wrote:



On 2022-10-05 08:59 pm, Steven Liu wrote:

Tristan Matthews  于2022年10月5日周三 22:44写道:

---
   libavformat/hls.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index e622425e80..402eb2b5a0 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1527,7 +1527,7 @@ reload:
   return AVERROR_EOF;
   }
   } else {
-av_log(v->parent, AV_LOG_WARNING, "maybe the m3u8 list

sequence have been wraped.\n");

+av_log(v->parent, AV_LOG_WARNING, "The m3u8 list sequence

may have been wrapped.\n");

   }
   if (v->cur_seq_no >= v->start_seq_no + v->n_segments) {
   if (v->finished)
--
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-requ...@ffmpeg.org with subject "unsubscribe".

English is not my native language, but this look ok to me.
Waiting for familiarity with English reviewer comments.

LGTM.


Ping?


Will push.

Regards,
Gyan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v1] avcodec/sbc_parser: Fix parser error when reading data slowly.

2022-10-19 Thread javashu2012
From: bevis 

When reading data is slow, such as 10 bytes at a time, the header bytes will be 
overwritten by the body data, resulting in an error in parsing the header.

Signed-off-by: bevis 
---
 libavcodec/sbc_parser.c | 34 --
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/libavcodec/sbc_parser.c b/libavcodec/sbc_parser.c
index 2d427cc7cb..bf471cf878 100644
--- a/libavcodec/sbc_parser.c
+++ b/libavcodec/sbc_parser.c
@@ -81,26 +81,40 @@ static int sbc_parse(AVCodecParserContext *s, 
AVCodecContext *avctx,
 {
 SBCParseContext *pc = s->priv_data;
 int next;
+int expected_header_size = sizeof(pc->header);
 
 if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
 next = buf_size;
 } else {
-if (pc->header_size) {
-memcpy(pc->header + pc->header_size, buf,
-   sizeof(pc->header) - pc->header_size);
-next = sbc_parse_header(s, avctx, pc->header, sizeof(pc->header))
- - pc->buffered_size;
-pc->header_size = 0;
-} else {
+if (!pc->header_size) {
 next = sbc_parse_header(s, avctx, buf, buf_size);
 if (next >= buf_size)
 next = -1;
+} else if (pc->header_size + buf_size >= expected_header_size) {
+if (pc->header_size < expected_header_size) {
+memcpy(pc->header + pc->header_size, buf,
+   expected_header_size - pc->header_size);
+pc->header_size = expected_header_size;
+}
+next = sbc_parse_header(s, avctx, pc->header, expected_header_size)
+ - pc->buffered_size;
+if (next >= buf_size) {
+next = -1;
+} else {
+pc->header_size = 0;
+pc->buffered_size = 0;
+}
+} else {
+next = -1;
 }
 
 if (next < 0) {
-pc->header_size = FFMIN(sizeof(pc->header), buf_size);
-memcpy(pc->header, buf, pc->header_size);
-pc->buffered_size = buf_size;
+if (pc->header_size < expected_header_size) {
+memcpy(pc->header + pc->header_size, buf,
+   FFMIN(buf_size, expected_header_size - 
pc->header_size));
+pc->header_size = FFMIN(expected_header_size, pc->header_size 
+ buf_size);
+}
+pc->buffered_size += buf_size;
 next = END_NOT_FOUND;
 }
 
-- 
2.30.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCHv2 3/4] avcodec/svq1enc: output ident string in extradata field

2022-10-19 Thread James Almer

On 10/19/2022 10:30 PM, Peter Ross wrote:

This will enable the acurate identification of FFmpeg produced
SVQ1 streams, should there be new bugs found in the encoder.
---
  libavcodec/svq1enc.c | 9 +
  1 file changed, 9 insertions(+)

diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 9bd5a04368..6aacaef88d 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -41,6 +41,7 @@
  #include "svq1.h"
  #include "svq1encdsp.h"
  #include "svq1enc_cb.h"
+#include "version.h"
  
  #include "libavutil/avassert.h"

  #include "libavutil/frame.h"
@@ -628,6 +629,14 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
  
  ff_h263_encode_init(>m); // mv_penalty
  
+if (!(s->avctx->flags & AV_CODEC_FLAG_BITEXACT)) {

+avctx->extradata = av_malloc(sizeof(LIBAVCODEC_IDENT));
+if (!avctx->extradata)
+return AVERROR(ENOMEM);
+memcpy(avctx->extradata, LIBAVCODEC_IDENT, sizeof(LIBAVCODEC_IDENT));
+avctx->extradata_size = sizeof(LIBAVCODEC_IDENT);


Can you explain what effect is this meant to have and where? Do or 
should muxers like mp4 and matroska expect extradata from svq1 streams 
that they are meant to write to the output file?



+}
+
  return 0;
  }
  



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCHv2 4/4] avcodec/svq1dec: detect buggy FFmpeg encoder and apply correction to interframe mean symbols

2022-10-19 Thread Peter Ross
---
 libavcodec/svq1dec.c | 32 +++-
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index 828b38b93d..c7269456e2 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -73,6 +73,8 @@ typedef struct SVQ1Context {
 int height;
 int frame_code;
 int nonref; // 1 if the current frame won't be referenced
+
+int last_tempref;
 } SVQ1Context;
 
 static const uint8_t string_table[256] = {
@@ -229,7 +231,7 @@ static int svq1_decode_block_intra(GetBitContext *bitbuf, 
uint8_t *pixels,
 }
 
 static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels,
-   ptrdiff_t pitch)
+   ptrdiff_t pitch, int buggy)
 {
 uint32_t bit_cache;
 uint8_t *list[63];
@@ -270,6 +272,13 @@ static int svq1_decode_block_non_intra(GetBitContext 
*bitbuf, uint8_t *pixels,
 
 mean = get_vlc2(bitbuf, svq1_inter_mean.table, 9, 3) - 256;
 
+if (buggy) {
+if (mean == -128)
+mean = 128;
+else if (mean == 128)
+mean = -128;
+}
+
 SVQ1_CALC_CODEBOOK_ENTRIES(ff_svq1_inter_codebooks);
 
 for (y = 0; y < height; y++) {
@@ -455,7 +464,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, 
HpelDSPContext *hdsp,
GetBitContext *bitbuf,
uint8_t *current, uint8_t *previous,
ptrdiff_t pitch, svq1_pmv *motion, int x, 
int y,
-   int width, int height)
+   int width, int height, int buggy)
 {
 uint32_t block_type;
 int result = 0;
@@ -487,7 +496,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, 
HpelDSPContext *hdsp,
 ff_dlog(avctx, "Error in svq1_motion_inter_block %i\n", result);
 break;
 }
-result = svq1_decode_block_non_intra(bitbuf, current, pitch);
+result = svq1_decode_block_non_intra(bitbuf, current, pitch, buggy);
 break;
 
 case SVQ1_BLOCK_INTER_4V:
@@ -498,7 +507,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, 
HpelDSPContext *hdsp,
 ff_dlog(avctx, "Error in svq1_motion_inter_4v_block %i\n", result);
 break;
 }
-result = svq1_decode_block_non_intra(bitbuf, current, pitch);
+result = svq1_decode_block_non_intra(bitbuf, current, pitch, buggy);
 break;
 
 case SVQ1_BLOCK_INTRA:
@@ -524,15 +533,18 @@ static void svq1_parse_string(GetBitContext *bitbuf, 
uint8_t out[257])
 out[i] = 0;
 }
 
-static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
+static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame, int 
* buggy)
 {
 SVQ1Context *s = avctx->priv_data;
 GetBitContext *bitbuf = >gb;
 int frame_size_code;
 int width  = s->width;
 int height = s->height;
+int tempref;
 
-skip_bits(bitbuf, 8); /* temporal_reference */
+tempref = get_bits(bitbuf, 8); /* temporal_reference */
+*buggy = tempref == 0 && s->last_tempref == 0 && avctx->extradata_size == 
0;
+s->last_tempref = tempref;
 
 /* frame type */
 s->nonref = 0;
@@ -624,7 +636,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame 
*cur,
 int buf_size   = avpkt->size;
 SVQ1Context *s = avctx->priv_data;
 uint8_t *current;
-int result, i, x, y, width, height;
+int result, i, x, y, width, height, buggy;
 int ret;
 
 /* initialize bit buffer */
@@ -664,7 +676,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame 
*cur,
 src[i] = ((src[i] << 16) | (src[i] >> 16)) ^ src[7 - i];
 }
 
-result = svq1_decode_frame_header(avctx, cur);
+result = svq1_decode_frame_header(avctx, cur, );
 if (result != 0) {
 ff_dlog(avctx, "Error in svq1_decode_frame_header %i\n", result);
 return result;
@@ -734,7 +746,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame 
*cur,
 result = svq1_decode_delta_block(avctx, >hdsp,
  >gb, [x],
  previous, linesize,
- s->pmv, x, y, width, 
height);
+ s->pmv, x, y, width, 
height, buggy);
 if (result != 0) {
 ff_dlog(avctx,
 "Error in svq1_decode_delta_block %i\n",
@@ -820,6 +832,8 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx)
 
 ff_thread_once(_static_once, svq1_static_init);
 
+s->last_tempref = 0xFF;
+
 return 0;
 }
 
-- 
2.35.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


signature.asc
Description: PGP 

[FFmpeg-devel] [PATCHv2 3/4] avcodec/svq1enc: output ident string in extradata field

2022-10-19 Thread Peter Ross
This will enable the acurate identification of FFmpeg produced
SVQ1 streams, should there be new bugs found in the encoder.
---
 libavcodec/svq1enc.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 9bd5a04368..6aacaef88d 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -41,6 +41,7 @@
 #include "svq1.h"
 #include "svq1encdsp.h"
 #include "svq1enc_cb.h"
+#include "version.h"
 
 #include "libavutil/avassert.h"
 #include "libavutil/frame.h"
@@ -628,6 +629,14 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
 
 ff_h263_encode_init(>m); // mv_penalty
 
+if (!(s->avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
+avctx->extradata = av_malloc(sizeof(LIBAVCODEC_IDENT));
+if (!avctx->extradata)
+return AVERROR(ENOMEM);
+memcpy(avctx->extradata, LIBAVCODEC_IDENT, sizeof(LIBAVCODEC_IDENT));
+avctx->extradata_size = sizeof(LIBAVCODEC_IDENT);
+}
+
 return 0;
 }
 
-- 
2.35.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCHv2 2/4] avcodec/svq1enc: do not use ambiguous interframe mean symbols

2022-10-19 Thread Peter Ross
Don't emit interframe mean symbols -128 and 128 to maintain compatibility with
older versions of FFmpeg that incorrectly interpret these symbols.
---
 libavcodec/svq1enc.c  |  5 +
 tests/ref/seek/vsynth_lena-svq1   | 28 ++--
 tests/ref/vsynth/vsynth1-svq1 |  8 
 tests/ref/vsynth/vsynth2-svq1 |  6 +++---
 tests/ref/vsynth/vsynth3-svq1 |  6 +++---
 tests/ref/vsynth/vsynth_lena-svq1 |  6 +++---
 6 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 75adbe7ea0..9bd5a04368 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -234,6 +234,11 @@ static int encode_block(SVQ1EncContext *s, uint8_t *src, 
uint8_t *ref,
 }
 }
 
+if (best_mean == -128)
+best_mean = -127;
+else if (best_mean == 128)
+best_mean = 127;
+
 split = 0;
 if (best_score > threshold && level) {
 int score  = 0;
diff --git a/tests/ref/seek/vsynth_lena-svq1 b/tests/ref/seek/vsynth_lena-svq1
index 33fe33e916..36c0fb7f4e 100644
--- a/tests/ref/seek/vsynth_lena-svq1
+++ b/tests/ref/seek/vsynth_lena-svq1
@@ -2,49 +2,49 @@ ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 
36 size: 22300
 ret: 0 st:-1 flags:0  ts:-1.00
 ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 36 size: 
22300
 ret: 0 st:-1 flags:1  ts: 1.894167
-ret: 0 st: 0 flags:1 dts: 1.44 pts: 1.44 pos: 517568 size: 
25636
+ret: 0 st: 0 flags:1 dts: 1.44 pts: 1.44 pos: 517672 size: 
25636
 ret: 0 st: 0 flags:0  ts: 0.788359
-ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos: 326556 size: 
23552
+ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos: 326616 size: 
23552
 ret: 0 st: 0 flags:1  ts:-0.317500
 ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 36 size: 
22300
 ret:-1 st:-1 flags:0  ts: 2.576668
 ret: 0 st:-1 flags:1  ts: 1.470835
-ret: 0 st: 0 flags:1 dts: 1.44 pts: 1.44 pos: 517568 size: 
25636
+ret: 0 st: 0 flags:1 dts: 1.44 pts: 1.44 pos: 517672 size: 
25636
 ret: 0 st: 0 flags:0  ts: 0.365000
-ret: 0 st: 0 flags:1 dts: 0.48 pts: 0.48 pos: 157040 size: 
21896
+ret: 0 st: 0 flags:1 dts: 0.48 pts: 0.48 pos: 157232 size: 
21896
 ret: 0 st: 0 flags:1  ts:-0.740859
 ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 36 size: 
22300
 ret:-1 st:-1 flags:0  ts: 2.153336
 ret: 0 st:-1 flags:1  ts: 1.047503
-ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos: 326556 size: 
23552
+ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos: 326616 size: 
23552
 ret: 0 st: 0 flags:0  ts:-0.058359
 ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 36 size: 
22300
 ret: 0 st: 0 flags:1  ts: 2.835859
-ret: 0 st: 0 flags:1 dts: 1.92 pts: 1.92 pos: 722804 size: 
25888
+ret: 0 st: 0 flags:1 dts: 1.92 pts: 1.92 pos: 722884 size: 
25888
 ret: 0 st:-1 flags:0  ts: 1.730004
-ret: 0 st: 0 flags:1 dts: 1.92 pts: 1.92 pos: 722804 size: 
25888
+ret: 0 st: 0 flags:1 dts: 1.92 pts: 1.92 pos: 722884 size: 
25888
 ret: 0 st:-1 flags:1  ts: 0.624171
-ret: 0 st: 0 flags:1 dts: 0.48 pts: 0.48 pos: 157040 size: 
21896
+ret: 0 st: 0 flags:1 dts: 0.48 pts: 0.48 pos: 157232 size: 
21896
 ret: 0 st: 0 flags:0  ts:-0.481641
 ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 36 size: 
22300
 ret: 0 st: 0 flags:1  ts: 2.412500
-ret: 0 st: 0 flags:1 dts: 1.92 pts: 1.92 pos: 722804 size: 
25888
+ret: 0 st: 0 flags:1 dts: 1.92 pts: 1.92 pos: 722884 size: 
25888
 ret: 0 st:-1 flags:0  ts: 1.306672
-ret: 0 st: 0 flags:1 dts: 1.44 pts: 1.44 pos: 517568 size: 
25636
+ret: 0 st: 0 flags:1 dts: 1.44 pts: 1.44 pos: 517672 size: 
25636
 ret: 0 st:-1 flags:1  ts: 0.200839
 ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 36 size: 
22300
 ret: 0 st: 0 flags:0  ts:-0.905000
 ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 36 size: 
22300
 ret: 0 st: 0 flags:1  ts: 1.989141
-ret: 0 st: 0 flags:1 dts: 1.92 pts: 1.92 pos: 722804 size: 
25888
+ret: 0 st: 0 flags:1 dts: 1.92 pts: 1.92 pos: 722884 size: 
25888
 ret: 0 st:-1 flags:0  ts: 0.883340
-ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos: 326556 size: 
23552
+ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos: 326616 size: 
23552
 ret: 0 st:-1 flags:1  ts:-0.222493
 ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 36 size: 
22300
 ret:-1 st: 0 flags:0  ts: 2.671641
 ret: 0 st: 0 flags:1  ts: 1.565859
-ret: 0 st: 0 

[FFmpeg-devel] [PATCHv2 1/4] avcodec/svq1: fix interframe mean VLC symbols

2022-10-19 Thread Peter Ross
Fixes ticket #128.

The SVQ1 interframe mean VLC symbols -128 and 128 are incorrectly swapped
in our SVQ1 implementation, resulting in visible artifacts for some videos.
This patch unswaps the order of these two symbols.

The most noticable example of the artiacts caused by this error can be observed 
in
https://trac.ffmpeg.org/attachment/ticket/128/svq1_set.7z '352_288_k_50.mov'.
The artifacts are not observed when using the reference decoder
(QuickTime 7.7.9 x86 binary).

As a result of this patch, the reference data for the fate-svq1 test
($SAMPLES/svq1/marymary-shackles.mov) must be modified. For this file, our
decoder output is now bitwise identical to the reference decoder. I have
tested patch with various other samples and they are all now bitwise identical.

The SVQ1 encoder also produces different output because of this change, so
the the vsynth test reference data has also been updated.
---
 libavcodec/svq1_vlc.h |  4 ++--
 tests/ref/fate/svq1   | 22 +++---
 tests/ref/vsynth/vsynth1-svq1 |  2 +-
 tests/ref/vsynth/vsynth2-svq1 |  4 ++--
 tests/ref/vsynth/vsynth_lena-svq1 |  2 +-
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavcodec/svq1_vlc.h b/libavcodec/svq1_vlc.h
index 06e3509e4d..5c27928c2a 100644
--- a/libavcodec/svq1_vlc.h
+++ b/libavcodec/svq1_vlc.h
@@ -167,7 +167,7 @@ const uint16_t ff_svq1_inter_mean_vlc[512][2] = {
 { 0xA0, 22 },  { 0xA1, 22 },  { 0xA2, 22 },  { 0xA3, 22 },
 { 0xA4, 22 },  { 0xA5, 22 },  { 0xA6, 22 },  { 0xA7, 22 },
 { 0xA8, 22 },  { 0xA9, 22 },  { 0xAA, 22 },  { 0xAB, 22 },
-{ 0x7F, 22 },  { 0x8F, 21 },  { 0xAC, 22 },  { 0xAD, 22 },
+{ 0x8E, 21 },  { 0x8F, 21 },  { 0xAC, 22 },  { 0xAD, 22 },
 { 0xAE, 22 },  { 0xAF, 22 },  { 0xB0, 22 },  { 0xB1, 22 },
 { 0x53, 20 },  { 0x90, 21 },  { 0xB2, 22 },  { 0x91, 21 },
 { 0xB3, 22 },  { 0xB4, 22 },  { 0x54, 20 },  { 0xB5, 22 },
@@ -231,7 +231,7 @@ const uint16_t ff_svq1_inter_mean_vlc[512][2] = {
 { 0x87, 21 },  { 0x4F, 20 },  { 0x35, 19 },  { 0x4E, 20 },
 { 0x33, 19 },  { 0x32, 19 },  { 0x4D, 20 },  { 0x4C, 20 },
 { 0x83, 22 },  { 0x4B, 20 },  { 0x81, 22 },  { 0x80, 22 },
-{ 0x8E, 21 },  { 0x7E, 22 },  { 0x7D, 22 },  { 0x84, 21 },
+{ 0x7F, 22 },  { 0x7E, 22 },  { 0x7D, 22 },  { 0x84, 21 },
 { 0x8D, 21 },  { 0x7A, 22 },  { 0x79, 22 },  { 0x4A, 20 },
 { 0x77, 22 },  { 0x76, 22 },  { 0x89, 21 },  { 0x74, 22 },
 { 0x73, 22 },  { 0x72, 22 },  { 0x49, 20 },  { 0x70, 22 },
diff --git a/tests/ref/fate/svq1 b/tests/ref/fate/svq1
index d53e2952e4..0b0948cce6 100644
--- a/tests/ref/fate/svq1
+++ b/tests/ref/fate/svq1
@@ -24,19 +24,19 @@
 0, 18, 18,1,21600, 0x8d5b2ad0
 0, 19, 19,1,21600, 0xe67128e6
 0, 20, 20,1,21600, 0xb7bf613e
-0, 21, 21,1,21600, 0xefd0f51b
-0, 22, 22,1,21600, 0x31b7da59
+0, 21, 21,1,21600, 0xf697fa3e
+0, 22, 22,1,21600, 0x5b6ede88
 0, 23, 23,1,21600, 0x7a84a8f7
 0, 24, 24,1,21600, 0x0351ad27
-0, 25, 25,1,21600, 0xed6f434d
-0, 26, 26,1,21600, 0x0e771127
-0, 27, 27,1,21600, 0x37bf0b95
-0, 28, 28,1,21600, 0x30e10a77
-0, 29, 29,1,21600, 0x1a48288a
-0, 30, 30,1,21600, 0xf43c6770
-0, 31, 31,1,21600, 0x3c43ae68
-0, 32, 32,1,21600, 0x04dc0949
-0, 33, 33,1,21600, 0x7920758d
+0, 25, 25,1,21600, 0x57b547c2
+0, 26, 26,1,21600, 0xbb9e1558
+0, 27, 27,1,21600, 0xcb470f6b
+0, 28, 28,1,21600, 0xeb100de0
+0, 29, 29,1,21600, 0x089c2bf0
+0, 30, 30,1,21600, 0xe27b6a42
+0, 31, 31,1,21600, 0xbfe2b11b
+0, 32, 32,1,21600, 0xd9ca0bb5
+0, 33, 33,1,21600, 0x12fe783c
 0, 34, 34,1,21600, 0x6c12bab5
 0, 35, 35,1,21600, 0x1ac23706
 0, 36, 36,1,21600, 0x7a95cb5f
diff --git a/tests/ref/vsynth/vsynth1-svq1 b/tests/ref/vsynth/vsynth1-svq1
index cb89915d22..1970f779fc 100644
--- a/tests/ref/vsynth/vsynth1-svq1
+++ b/tests/ref/vsynth/vsynth1-svq1
@@ -1,4 +1,4 @@
-39ec74da265e3ef27756618108641181 *tests/data/fate/vsynth1-svq1.mov
+66933a2b34e123a9fc612cbc4dbbe353 *tests/data/fate/vsynth1-svq1.mov
 1334233 tests/data/fate/vsynth1-svq1.mov
 9cc35c54b2c77d36bd7e308b393c1f81 *tests/data/fate/vsynth1-svq1.out.rawvideo
 stddev:9.58 PSNR: 28.50 MAXDIFF:  210 bytes:  7603200/  7603200
diff --git 

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/libsvtav1: replace vbv_bufsize with maximum_buffer_size_ms

2022-10-19 Thread Christopher Degawa
On Wed, Oct 19, 2022 at 7:00 PM James Almer  wrote:

> On 10/19/2022 7:47 PM, Christopher Degawa wrote:
> > From: Christopher Degawa 
> > diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> > index 28da206cf8..74dad9892b 100644
> > --- a/libavcodec/libsvtav1.c
> > +++ b/libavcodec/libsvtav1.c
> > @@ -179,7 +179,7 @@ static int
> config_enc_params(EbSvtAv1EncConfiguration *param,
> >   param->min_qp_allowed   = avctx->qmin;
> >   }
> >   param->max_bit_rate = avctx->rc_max_rate;
> > -param->vbv_bufsize  = avctx->rc_buffer_size;
> > +param->maximum_buffer_size_ms   = avctx->rc_buffer_size * 1000 /
> avctx->bit_rate;
>
> 1000LL. The multiplication could overflow otherwise.
>

Thanks, replaced locally.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v1 03/11] avcodec: enable cbs for H266/VVC

2022-10-19 Thread James Almer

On 10/19/2022 4:25 AM, thomas...@spin-digital.com wrote:

From: Thomas Siedel 

Add ff_cbs_type_h266 to cbs types tables and AV_CODEC_ID_H266 to cbs codec ids.
Change CBS_MAX_UNIT_TYPES to 8 as VVC implements 8 different slice types

Signed-off-by: Thomas Siedel 
---
  libavcodec/Makefile   | 1 +
  libavcodec/cbs.c  | 6 ++
  libavcodec/cbs_internal.h | 3 ++-
  3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c7dc5da0f9..b3fcf173e9 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -76,6 +76,7 @@ OBJS-$(CONFIG_CBS) += cbs.o cbs_bsf.o
  OBJS-$(CONFIG_CBS_AV1) += cbs_av1.o
  OBJS-$(CONFIG_CBS_H264)+= cbs_h2645.o cbs_sei.o h2645_parse.o
  OBJS-$(CONFIG_CBS_H265)+= cbs_h2645.o cbs_sei.o h2645_parse.o
+OBJS-$(CONFIG_CBS_H266)+= cbs_h2645.o cbs_sei.o h2645_parse.o


CONFIG_CBS_H266 is undefined. You need to add cbs_h266 to configure here 
instead of in patch 4/11, even if no module selects it just yet.


Also, this patch should be squashed with patch 2/11.


  OBJS-$(CONFIG_CBS_JPEG)+= cbs_jpeg.o
  OBJS-$(CONFIG_CBS_MPEG2)   += cbs_mpeg2.o
  OBJS-$(CONFIG_CBS_VP9) += cbs_vp9.o
diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c
index 8d6e3c3442..f01726aa37 100644
--- a/libavcodec/cbs.c
+++ b/libavcodec/cbs.c
@@ -40,6 +40,9 @@ static const CodedBitstreamType *const cbs_type_table[] = {
  #if CONFIG_CBS_H265
  _cbs_type_h265,
  #endif
+#if CONFIG_CBS_H266
+_cbs_type_h266,
+#endif
  #if CONFIG_CBS_JPEG
  _cbs_type_jpeg,
  #endif
@@ -61,6 +64,9 @@ const enum AVCodecID ff_cbs_all_codec_ids[] = {
  #if CONFIG_CBS_H265
  AV_CODEC_ID_H265,
  #endif
+#if CONFIG_CBS_H266
+AV_CODEC_ID_H266,
+#endif
  #if CONFIG_CBS_JPEG
  AV_CODEC_ID_MJPEG,
  #endif
diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h
index 5ccba3c901..b741030da4 100644
--- a/libavcodec/cbs_internal.h
+++ b/libavcodec/cbs_internal.h
@@ -45,7 +45,7 @@ enum CBSContentType {
  enum {
// Maximum number of unit types described by the same unit type
// descriptor.
-  CBS_MAX_UNIT_TYPES  = 3,
+  CBS_MAX_UNIT_TYPES  = 8,
// Maximum number of reference buffer offsets in any one unit.
CBS_MAX_REF_OFFSETS = 2,
// Special value used in a unit type descriptor to indicate that it
@@ -242,6 +242,7 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, 
PutBitContext *pbc,
  extern const CodedBitstreamType ff_cbs_type_av1;
  extern const CodedBitstreamType ff_cbs_type_h264;
  extern const CodedBitstreamType ff_cbs_type_h265;
+extern const CodedBitstreamType ff_cbs_type_h266;
  extern const CodedBitstreamType ff_cbs_type_jpeg;
  extern const CodedBitstreamType ff_cbs_type_mpeg2;
  extern const CodedBitstreamType ff_cbs_type_vp9;

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/libsvtav1: replace vbv_bufsize with maximum_buffer_size_ms

2022-10-19 Thread James Almer

On 10/19/2022 7:47 PM, Christopher Degawa wrote:

From: Christopher Degawa 

svt-av1 v1.2.0 has deprecated vbv_bufsize in favor of using
- maximum_buffer_size_ms (--buf-sz)
- starting_buffer_level_ms (--buf-initial-sz)
- optimal_buffer_level_ms (--buf-optimal-sz)

and vbv_bufsize has not been in use since svt-av1 v0.8.6

Signed-off-by: Christopher Degawa 
---
  libavcodec/libsvtav1.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index 28da206cf8..74dad9892b 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -179,7 +179,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration 
*param,
  param->min_qp_allowed   = avctx->qmin;
  }
  param->max_bit_rate = avctx->rc_max_rate;
-param->vbv_bufsize  = avctx->rc_buffer_size;
+param->maximum_buffer_size_ms   = avctx->rc_buffer_size * 1000 / 
avctx->bit_rate;


1000LL. The multiplication could overflow otherwise.

  
  if (svt_enc->crf > 0) {

  param->qp   = svt_enc->crf;
@@ -296,7 +296,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration 
*param,
  avctx->bit_rate   = param->rate_control_mode > 0 ?
  param->target_bit_rate : 0;
  avctx->rc_max_rate= param->max_bit_rate;
-avctx->rc_buffer_size = param->vbv_bufsize;
+avctx->rc_buffer_size = param->maximum_buffer_size_ms * avctx->bit_rate / 
1000;
  
  if (avctx->bit_rate || avctx->rc_max_rate || avctx->rc_buffer_size) {

  AVCPBProperties *cpb_props = ff_add_cpb_side_data(avctx);

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 2/2] avcodec/libsvtav1: replace vbv_bufsize with maximum_buffer_size_ms

2022-10-19 Thread Christopher Degawa
From: Christopher Degawa 

svt-av1 v1.2.0 has deprecated vbv_bufsize in favor of using
- maximum_buffer_size_ms (--buf-sz)
- starting_buffer_level_ms (--buf-initial-sz)
- optimal_buffer_level_ms (--buf-optimal-sz)

and vbv_bufsize has not been in use since svt-av1 v0.8.6

Signed-off-by: Christopher Degawa 
---
 libavcodec/libsvtav1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index 28da206cf8..74dad9892b 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -179,7 +179,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration 
*param,
 param->min_qp_allowed   = avctx->qmin;
 }
 param->max_bit_rate = avctx->rc_max_rate;
-param->vbv_bufsize  = avctx->rc_buffer_size;
+param->maximum_buffer_size_ms   = avctx->rc_buffer_size * 1000 / 
avctx->bit_rate;
 
 if (svt_enc->crf > 0) {
 param->qp   = svt_enc->crf;
@@ -296,7 +296,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration 
*param,
 avctx->bit_rate   = param->rate_control_mode > 0 ?
 param->target_bit_rate : 0;
 avctx->rc_max_rate= param->max_bit_rate;
-avctx->rc_buffer_size = param->vbv_bufsize;
+avctx->rc_buffer_size = param->maximum_buffer_size_ms * avctx->bit_rate / 
1000;
 
 if (avctx->bit_rate || avctx->rc_max_rate || avctx->rc_buffer_size) {
 AVCPBProperties *cpb_props = ff_add_cpb_side_data(avctx);
-- 
2.38.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/2] avcodec/libsvtav1: remove compressed_ten_bit_format and simplify alloc_buffer

2022-10-19 Thread Christopher Degawa
From: Christopher Degawa 

compressed_ten_bit_format has been deprecated upstream and has no effect
and can be removed. Plus, technically it was never used in the first place
since it would require the app (ffmpeg) to set it and do additional
processing of the input frames.

Also simplify alloc_buffer by removing calculations relating to the
non-existant processing.

Signed-off-by: Christopher Degawa 
---
 libavcodec/libsvtav1.c | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index 2f5634cee0..28da206cf8 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -124,16 +124,12 @@ static int svt_print_error(void *log_ctx, EbErrorType err,
 
 static int alloc_buffer(EbSvtAv1EncConfiguration *config, SvtContext *svt_enc)
 {
-const intpack_mode_10bit =
-(config->encoder_bit_depth > 8) && (config->compressed_ten_bit_format 
== 0) ? 1 : 0;
-const size_t luma_size_8bit  =
-config->source_width * config->source_height * (1 << pack_mode_10bit);
-const size_t luma_size_10bit =
-(config->encoder_bit_depth > 8 && pack_mode_10bit == 0) ? 
luma_size_8bit : 0;
+const size_t luma_size = config->source_width * config->source_height *
+(config->encoder_bit_depth > 8 ? 2 : 1);
 
 EbSvtIOFormat *in_data;
 
-svt_enc->raw_size = (luma_size_8bit + luma_size_10bit) * 3 / 2;
+svt_enc->raw_size = luma_size * 3 / 2;
 
 // allocate buffer for in and out
 svt_enc->in_buf   = av_mallocz(sizeof(*svt_enc->in_buf));
-- 
2.38.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 2/2] avocdec/cbs_internal: Rename CBS_MAX_UNIT_TYPES->CBS_MAX_LIST_UNIT_TYPES

2022-10-19 Thread Andreas Rheinhardt
This makes it clearer that this limit does not apply to
CBS_UNIT_TYPE_RANGE units.

Signed-off-by: Andreas Rheinhardt 
---
Inspired by https://ffmpeg.org/pipermail/ffmpeg-devel/2022-October/303005.html

 libavcodec/cbs_internal.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h
index 045df91744..7887552269 100644
--- a/libavcodec/cbs_internal.h
+++ b/libavcodec/cbs_internal.h
@@ -41,9 +41,9 @@ enum CBSContentType {
 };
 
 enum {
-  // Maximum number of unit types described by the same unit type
-  // descriptor.
-  CBS_MAX_UNIT_TYPES  = 3,
+  // Maximum number of unit types described by the same non-range
+  // unit type descriptor.
+  CBS_MAX_LIST_UNIT_TYPES  = 3,
   // Maximum number of reference buffer offsets in any one unit.
   CBS_MAX_REF_OFFSETS = 2,
   // Special value used in a unit type descriptor to indicate that it
@@ -60,7 +60,7 @@ typedef const struct CodedBitstreamUnitTypeDescriptor {
 
 union {
 // Array of unit types that this entry describes.
-CodedBitstreamUnitType list[CBS_MAX_UNIT_TYPES];
+CodedBitstreamUnitType list[CBS_MAX_LIST_UNIT_TYPES];
 // Start and end of unit type range, used if nb_unit_types is
 // CBS_UNIT_TYPE_RANGE.
 struct {
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avformat/hls: fix spelling and grammar on wrap warning

2022-10-19 Thread Tristan Matthews
On Fri, Oct 7, 2022 at 1:41 AM Gyan Doshi  wrote:

>
>
> On 2022-10-05 08:59 pm, Steven Liu wrote:
> > Tristan Matthews  于2022年10月5日周三 22:44写道:
> >> ---
> >>   libavformat/hls.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/libavformat/hls.c b/libavformat/hls.c
> >> index e622425e80..402eb2b5a0 100644
> >> --- a/libavformat/hls.c
> >> +++ b/libavformat/hls.c
> >> @@ -1527,7 +1527,7 @@ reload:
> >>   return AVERROR_EOF;
> >>   }
> >>   } else {
> >> -av_log(v->parent, AV_LOG_WARNING, "maybe the m3u8 list
> sequence have been wraped.\n");
> >> +av_log(v->parent, AV_LOG_WARNING, "The m3u8 list sequence
> may have been wrapped.\n");
> >>   }
> >>   if (v->cur_seq_no >= v->start_seq_no + v->n_segments) {
> >>   if (v->finished)
> >> --
> >> 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-requ...@ffmpeg.org with subject "unsubscribe".
> > English is not my native language, but this look ok to me.
> > Waiting for familiarity with English reviewer comments.
>
> LGTM.
>

Ping?

Best,
-t
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/2] avcodec/cbs: Remove CBS_CONTENT_TYPE_POD

2022-10-19 Thread Andreas Rheinhardt
It is equivalent to CBS_CONTENT_TYPE_INTERNAL_REFS
with nb_offsets equal to zero.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/cbs.c  | 18 --
 libavcodec/cbs_internal.h | 21 -
 2 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c
index 8d6e3c3442..504197e06d 100644
--- a/libavcodec/cbs.c
+++ b/libavcodec/cbs.c
@@ -839,12 +839,10 @@ void ff_cbs_delete_unit(CodedBitstreamFragment *frag,
 static void cbs_default_free_unit_content(void *opaque, uint8_t *data)
 {
 const CodedBitstreamUnitTypeDescriptor *desc = opaque;
-if (desc->content_type == CBS_CONTENT_TYPE_INTERNAL_REFS) {
-int i;
-for (i = 0; i < desc->type.ref.nb_offsets; i++) {
-void **ptr = (void**)(data + desc->type.ref.offsets[i]);
-av_buffer_unref((AVBufferRef**)(ptr + 1));
-}
+
+for (int i = 0; i < desc->type.ref.nb_offsets; i++) {
+void **ptr = (void**)(data + desc->type.ref.offsets[i]);
+av_buffer_unref((AVBufferRef**)(ptr + 1));
 }
 av_free(data);
 }
@@ -981,14 +979,6 @@ static int cbs_clone_unit_content(CodedBitstreamContext 
*ctx,
 return AVERROR(ENOSYS);
 
 switch (desc->content_type) {
-case CBS_CONTENT_TYPE_POD:
-ref = av_buffer_alloc(desc->content_size);
-if (!ref)
-return AVERROR(ENOMEM);
-memcpy(ref->data, unit->content, desc->content_size);
-err = 0;
-break;
-
 case CBS_CONTENT_TYPE_INTERNAL_REFS:
 err = cbs_clone_internal_refs_unit_content(, unit, desc);
 break;
diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h
index 5ccba3c901..045df91744 100644
--- a/libavcodec/cbs_internal.h
+++ b/libavcodec/cbs_internal.h
@@ -31,9 +31,7 @@
 
 
 enum CBSContentType {
-// Unit content is a simple structure.
-CBS_CONTENT_TYPE_POD,
-// Unit content contains some references to other structures, but all
+// Unit content may contain some references to other structures, but all
 // managed via buffer reference counting.  The descriptor defines the
 // structure offsets of every buffer reference.
 CBS_CONTENT_TYPE_INTERNAL_REFS,
@@ -78,9 +76,12 @@ typedef const struct CodedBitstreamUnitTypeDescriptor {
 size_t content_size;
 
 union {
+// This union's state is determined by content_type:
+// ref for CBS_CONTENT_TYPE_INTERNAL_REFS,
+// complex for CBS_CONTENT_TYPE_COMPLEX.
 struct {
-// Number of entries in the ref_offsets array.  Only nonzero
-// if the content_type is CBS_CONTENT_TYPE_INTERNAL_REFS.
+// Number of entries in the ref_offsets array.
+// May be zero, then the structure is POD-like.
 int nb_offsets;
 // The structure must contain two adjacent elements:
 //   type*field;
@@ -191,18 +192,20 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, 
PutBitContext *pbc,
 #define MIN_INT_BITS(length) (-(INT64_C(1) << ((length) - 1)))
 
 #define TYPE_LIST(...) { __VA_ARGS__ }
-#define CBS_UNIT_TYPE_POD(type, structure) { \
+#define CBS_UNIT_TYPE_POD(type_, structure) { \
 .nb_unit_types  = 1, \
-.unit_type.list = { type }, \
-.content_type   = CBS_CONTENT_TYPE_POD, \
+.unit_type.list = { type_ }, \
+.content_type   = CBS_CONTENT_TYPE_INTERNAL_REFS, \
 .content_size   = sizeof(structure), \
+.type.ref   = { .nb_offsets = 0 }, \
 }
 #define CBS_UNIT_RANGE_POD(range_start, range_end, structure) { \
 .nb_unit_types = CBS_UNIT_TYPE_RANGE, \
 .unit_type.range.start = range_start, \
 .unit_type.range.end   = range_end, \
-.content_type  = CBS_CONTENT_TYPE_POD, \
+.content_type  = CBS_CONTENT_TYPE_INTERNAL_REFS, \
 .content_size  = sizeof(structure), \
+.type.ref  = { .nb_offsets = 0 }, \
 }
 
 #define CBS_UNIT_TYPES_INTERNAL_REF(types, structure, ref_field) { \
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/6] avcodec/mpegvideo_motion: Move mspel/gmc motion to mpeg4videodec.c

2022-10-19 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> It is the only codec for which mcsel is ever set.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/mpeg4videodec.c| 168 ++
>  libavcodec/mpeg4videodec.h|   3 +
>  libavcodec/mpegvideo_motion.c | 166 +
>  3 files changed, 174 insertions(+), 163 deletions(-)
> 
> diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
> index 4dbf37afe5..58a8ac9027 100644
> --- a/libavcodec/mpeg4videodec.c
> +++ b/libavcodec/mpeg4videodec.c
> @@ -72,6 +72,174 @@ static const int mb_type_b_map[4] = {
>  MB_TYPE_L0  | MB_TYPE_16x16,
>  };
>  
> +static void gmc1_motion(MpegEncContext *s,
> +uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
> +uint8_t *const *ref_picture)
> +{
> +const uint8_t *ptr;
> +int src_x, src_y, motion_x, motion_y;
> +ptrdiff_t offset, linesize, uvlinesize;
> +int emu = 0;
> +
> +motion_x   = s->sprite_offset[0][0];
> +motion_y   = s->sprite_offset[0][1];
> +src_x  = s->mb_x * 16 + (motion_x >> (s->sprite_warping_accuracy + 
> 1));
> +src_y  = s->mb_y * 16 + (motion_y >> (s->sprite_warping_accuracy + 
> 1));
> +motion_x *= 1 << (3 - s->sprite_warping_accuracy);
> +motion_y *= 1 << (3 - s->sprite_warping_accuracy);
> +src_x  = av_clip(src_x, -16, s->width);
> +if (src_x == s->width)
> +motion_x = 0;
> +src_y = av_clip(src_y, -16, s->height);
> +if (src_y == s->height)
> +motion_y = 0;
> +
> +linesize   = s->linesize;
> +uvlinesize = s->uvlinesize;
> +
> +ptr = ref_picture[0] + src_y * linesize + src_x;
> +
> +if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) ||
> +(unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) {
> +s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr,
> + linesize, linesize,
> + 17, 17,
> + src_x, src_y,
> + s->h_edge_pos, s->v_edge_pos);
> +ptr = s->sc.edge_emu_buffer;
> +}
> +
> +if ((motion_x | motion_y) & 7) {
> +s->mdsp.gmc1(dest_y, ptr, linesize, 16,
> + motion_x & 15, motion_y & 15, 128 - s->no_rounding);
> +s->mdsp.gmc1(dest_y + 8, ptr + 8, linesize, 16,
> + motion_x & 15, motion_y & 15, 128 - s->no_rounding);
> +} else {
> +int dxy;
> +
> +dxy = ((motion_x >> 3) & 1) | ((motion_y >> 2) & 2);
> +if (s->no_rounding) {
> +s->hdsp.put_no_rnd_pixels_tab[0][dxy](dest_y, ptr, linesize, 16);
> +} else {
> +s->hdsp.put_pixels_tab[0][dxy](dest_y, ptr, linesize, 16);
> +}
> +}
> +
> +if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY)
> +return;
> +
> +motion_x   = s->sprite_offset[1][0];
> +motion_y   = s->sprite_offset[1][1];
> +src_x  = s->mb_x * 8 + (motion_x >> (s->sprite_warping_accuracy + 
> 1));
> +src_y  = s->mb_y * 8 + (motion_y >> (s->sprite_warping_accuracy + 
> 1));
> +motion_x  *= 1 << (3 - s->sprite_warping_accuracy);
> +motion_y  *= 1 << (3 - s->sprite_warping_accuracy);
> +src_x  = av_clip(src_x, -8, s->width >> 1);
> +if (src_x == s->width >> 1)
> +motion_x = 0;
> +src_y = av_clip(src_y, -8, s->height >> 1);
> +if (src_y == s->height >> 1)
> +motion_y = 0;
> +
> +offset = (src_y * uvlinesize) + src_x;
> +ptr= ref_picture[1] + offset;
> +if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) ||
> +(unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) {
> +s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr,
> + uvlinesize, uvlinesize,
> + 9, 9,
> + src_x, src_y,
> + s->h_edge_pos >> 1, s->v_edge_pos >> 1);
> +ptr = s->sc.edge_emu_buffer;
> +emu = 1;
> +}
> +s->mdsp.gmc1(dest_cb, ptr, uvlinesize, 8,
> + motion_x & 15, motion_y & 15, 128 - s->no_rounding);
> +
> +ptr = ref_picture[2] + offset;
> +if (emu) {
> +s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr,
> + uvlinesize, uvlinesize,
> + 9, 9,
> + src_x, src_y,
> + s->h_edge_pos >> 1, s->v_edge_pos >> 1);
> +ptr = s->sc.edge_emu_buffer;
> +}
> +s->mdsp.gmc1(dest_cr, ptr, uvlinesize, 8,
> + motion_x & 15, motion_y & 15, 128 - s->no_rounding);
> +}
> +
> +static void gmc_motion(MpegEncContext *s,
> +   uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
> +   uint8_t *const *ref_picture)
> +{
> +const uint8_t *ptr;
> +int linesize, uvlinesize;
> +const 

Re: [FFmpeg-devel] [PATCH 1/9] avcodec/(ffv1|h264|png|snow)dec: Remove comment out DRAW_HORIZ_BAND cap

2022-10-19 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/ffv1dec.c | 2 +-
>  libavcodec/h264dec.c | 2 +-
>  libavcodec/pngdec.c  | 4 ++--
>  libavcodec/snowdec.c | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
> index d4bc60a7da..9a610c2ff9 100644
> --- a/libavcodec/ffv1dec.c
> +++ b/libavcodec/ffv1dec.c
> @@ -1099,7 +1099,7 @@ const FFCodec ff_ffv1_decoder = {
>  .close  = ffv1_decode_close,
>  FF_CODEC_DECODE_CB(decode_frame),
>  UPDATE_THREAD_CONTEXT(update_thread_context),
> -.p.capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/ |
> +.p.capabilities = AV_CODEC_CAP_DR1 |
>AV_CODEC_CAP_FRAME_THREADS | 
> AV_CODEC_CAP_SLICE_THREADS,
>  .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP |
>FF_CODEC_CAP_ALLOCATE_PROGRESS,
> diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
> index 8f56f3ff92..6ede4e8c9f 100644
> --- a/libavcodec/h264dec.c
> +++ b/libavcodec/h264dec.c
> @@ -1075,7 +1075,7 @@ const FFCodec ff_h264_decoder = {
>  .init  = h264_decode_init,
>  .close = h264_decode_end,
>  FF_CODEC_DECODE_CB(h264_decode_frame),
> -.p.capabilities= /*AV_CODEC_CAP_DRAW_HORIZ_BAND |*/ 
> AV_CODEC_CAP_DR1 |
> +.p.capabilities= AV_CODEC_CAP_DR1 |
>   AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS 
> |
>   AV_CODEC_CAP_FRAME_THREADS,
>  .hw_configs= (const AVCodecHWConfigInternal *const []) {
> diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
> index 3c3eca601e..8080094d65 100644
> --- a/libavcodec/pngdec.c
> +++ b/libavcodec/pngdec.c
> @@ -1723,7 +1723,7 @@ const FFCodec ff_apng_decoder = {
>  .close  = png_dec_end,
>  FF_CODEC_DECODE_CB(decode_frame_apng),
>  UPDATE_THREAD_CONTEXT(update_thread_context),
> -.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| 
> AV_CODEC_CAP_DRAW_HORIZ_BAND*/,
> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
>  .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP |
>FF_CODEC_CAP_ALLOCATE_PROGRESS |
>FF_CODEC_CAP_ICC_PROFILES,
> @@ -1741,7 +1741,7 @@ const FFCodec ff_png_decoder = {
>  .close  = png_dec_end,
>  FF_CODEC_DECODE_CB(decode_frame_png),
>  UPDATE_THREAD_CONTEXT(update_thread_context),
> -.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| 
> AV_CODEC_CAP_DRAW_HORIZ_BAND*/,
> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
>  .caps_internal  = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM |
>FF_CODEC_CAP_ALLOCATE_PROGRESS | 
> FF_CODEC_CAP_INIT_CLEANUP |
>FF_CODEC_CAP_ICC_PROFILES,
> diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
> index 5c95ffde11..bed29d3390 100644
> --- a/libavcodec/snowdec.c
> +++ b/libavcodec/snowdec.c
> @@ -662,6 +662,6 @@ const FFCodec ff_snow_decoder = {
>  .init   = ff_snow_common_init,
>  .close  = decode_end,
>  FF_CODEC_DECODE_CB(decode_frame),
> -.p.capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/,
> +.p.capabilities = AV_CODEC_CAP_DR1,
>  .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
>  };

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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/6] avcodec/mpegvideo: Ignore skip_idct for encoders

2022-10-19 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> It is documented to be unused for encoders.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/mpegvideo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> index 5095149eaa..448b65bb96 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -1413,7 +1413,6 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, 
> int16_t block[12][64],
>  ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 1, 
> s->next_picture.f->data, op_pix, op_qpix);
>  }
>  }
> -}
>  
>  /* skip dequant / idct if we are really late ;) */
>  if(s->avctx->skip_idct){
> @@ -1422,6 +1421,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, 
> int16_t block[12][64],
> || s->avctx->skip_idct >= AVDISCARD_ALL)
>  goto skip_idct;
>  }
> +}
>  
>  /* add dct residue */
>  if (IS_ENCODER(s) || !(IS_MPEG12(s) || s->msmpeg4_version

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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v1 06/11] avformat: add demuxer and probe support for H266/VVC

2022-10-19 Thread Michael Niedermayer
On Wed, Oct 19, 2022 at 09:25:03AM +0200, thomas...@spin-digital.com wrote:
> From: Thomas Siedel 
> 
> Add demuxer to probe raw vvc and parse vvcc byte stream format.
> 
> Signed-off-by: Thomas Siedel 
> ---
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/demux.c  |   7 +-
>  libavformat/vvc.c| 918 +++
>  libavformat/vvc.h|  99 +
>  libavformat/vvcdec.c |  61 +++
>  6 files changed, 1085 insertions(+), 2 deletions(-)
>  create mode 100644 libavformat/vvc.c
>  create mode 100644 libavformat/vvc.h
>  create mode 100644 libavformat/vvcdec.c
> 
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index d7f198bf39..00ab4ded89 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -595,6 +595,7 @@ OBJS-$(CONFIG_VOC_MUXER) += vocenc.o voc.o
>  OBJS-$(CONFIG_VPK_DEMUXER)   += vpk.o
>  OBJS-$(CONFIG_VPLAYER_DEMUXER)   += vplayerdec.o subtitles.o
>  OBJS-$(CONFIG_VQF_DEMUXER)   += vqf.o
> +OBJS-$(CONFIG_VVC_DEMUXER)   += vvcdec.o rawdec.o
>  OBJS-$(CONFIG_W64_DEMUXER)   += wavdec.o w64.o pcm.o
>  OBJS-$(CONFIG_W64_MUXER) += wavenc.o w64.o
>  OBJS-$(CONFIG_WAV_DEMUXER)   += wavdec.o pcm.o
> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> index 47c419a009..a4e3822681 100644
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -474,6 +474,7 @@ extern const AVOutputFormat ff_voc_muxer;
>  extern const AVInputFormat  ff_vpk_demuxer;
>  extern const AVInputFormat  ff_vplayer_demuxer;
>  extern const AVInputFormat  ff_vqf_demuxer;
> +extern const AVInputFormat  ff_vvc_demuxer;
>  extern const AVInputFormat  ff_w64_demuxer;
>  extern const AVOutputFormat ff_w64_muxer;
>  extern const AVInputFormat  ff_wav_demuxer;
> diff --git a/libavformat/demux.c b/libavformat/demux.c
> index 2dfd82a63c..8dbde23fcd 100644
> --- a/libavformat/demux.c
> +++ b/libavformat/demux.c
> @@ -120,6 +120,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, 
> AVStream *st,
>  { "mp3",AV_CODEC_ID_MP3,  AVMEDIA_TYPE_AUDIO},
>  { "mpegvideo",  AV_CODEC_ID_MPEG2VIDEO,   AVMEDIA_TYPE_VIDEO},
>  { "truehd", AV_CODEC_ID_TRUEHD,   AVMEDIA_TYPE_AUDIO},
> +{ "vvc",AV_CODEC_ID_VVC,  AVMEDIA_TYPE_VIDEO},
>  { 0 }
>  };
>  int score;
> @@ -743,7 +744,8 @@ static int64_t select_from_pts_buffer(AVStream *st, 
> int64_t *pts_buffer, int64_t
>  {
>  FFStream *const sti = ffstream(st);
>  int onein_oneout = st->codecpar->codec_id != AV_CODEC_ID_H264 &&
> -   st->codecpar->codec_id != AV_CODEC_ID_HEVC;
> +   st->codecpar->codec_id != AV_CODEC_ID_HEVC &&
> +   st->codecpar->codec_id != AV_CODEC_ID_VVC;
>  
>  if (!onein_oneout) {
>  int delay = sti->avctx->has_b_frames;
> @@ -933,7 +935,8 @@ static void compute_pkt_fields(AVFormatContext *s, 
> AVStream *st,
>  int64_t offset;
>  AVRational duration;
>  int onein_oneout = st->codecpar->codec_id != AV_CODEC_ID_H264 &&
> -   st->codecpar->codec_id != AV_CODEC_ID_HEVC;
> +   st->codecpar->codec_id != AV_CODEC_ID_HEVC &&
> +   st->codecpar->codec_id != AV_CODEC_ID_VVC;
>  
>  if (s->flags & AVFMT_FLAG_NOFILLIN)
>  return;
> diff --git a/libavformat/vvc.c b/libavformat/vvc.c
> new file mode 100644
> index 00..fd0527242f
> --- /dev/null
> +++ b/libavformat/vvc.c
> @@ -0,0 +1,918 @@
> +/*
> + * VVC helper functions for muxers
> + *
> + * Copyright (C) 2022, Thomas Siedel
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
> + */
> +
> +#include "libavcodec/get_bits.h"
> +#include "libavcodec/golomb.h"
> +#include "libavcodec/vvc.h"
> +#include "libavutil/intreadwrite.h"
> +#include "avc.h"
> +#include "avio.h"
> +#include "avio_internal.h"
> +#include "vvc.h"
> +
> +typedef struct VVCCNALUnitArray {
> +uint8_t  array_completeness;
> +uint8_t  NAL_unit_type;
> +uint16_t num_nalus;
> +uint16_t *nal_unit_length;
> +uint8_t  

Re: [FFmpeg-devel] [PATCH v7 0/2] ffmpeg: Add display_{rotation, hflip, vflip} options

2022-10-19 Thread Thilo Borgmann

Am 19.10.22 um 12:04 schrieb Thilo Borgmann:

Am 15.10.22 um 12:25 schrieb Thilo Borgmann:

Hi,

this is an almost identical rebased version of Jan's patchset discussed in [1], 
now v7...

Should fix #8329 and #6370.


Fixed with two more nits, OK'd by Anton via Jitsi.


Pushed with...


Thanks,
Thilo
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v7 0/2] ffmpeg: Add display_{rotation, hflip, vflip} options

2022-10-19 Thread Thilo Borgmann

Am 15.10.22 um 12:25 schrieb Thilo Borgmann:

Hi,

this is an almost identical rebased version of Jan's patchset discussed in [1], 
now v7...

Should fix #8329 and #6370.


Fixed with two more nits, OK'd by Anton via Jitsi.

Thanks,
Thilo
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avcodec/dpx: fix check of minimal data size for unpadded content

2022-10-19 Thread Jerome Martinez
stride value is not relevant with unpadded content and the total count 
of pixels (width x height) must be used instead of the rounding based on 
width only then multiplied by height


unpadded_10bit value computing is moved sooner in the code in order to 
be able to use it during computing of minimal content size


Fix 'Overread buffer' error when the content is not lucky enough to have 
(enough) padding bytes at the end for not being rejected by the formula 
based on the stride value


Signed-off-by: Jerome Martinez 
---
 libavcodec/dpx.c | 34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index 4f50608..d4699f6 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -476,14 +476,30 @@ static int decode_frame(AVCodecContext *avctx, 
AVFrame *p,

 avctx->colorspace = AVCOL_SPC_RGB;
 }

+    av_strlcpy(creator, avpkt->data + 160, 100);
+    creator[100] = '\0';
+    av_dict_set(>metadata, "Creator", creator, 0);
+
+    av_strlcpy(input_device, avpkt->data + 1556, 32);
+    input_device[32] = '\0';
+    av_dict_set(>metadata, "Input Device", input_device, 0);
+
+    // Some devices do not pad 10bit samples to whole 32bit words per row
+    if (!memcmp(input_device, "Scanity", 7) ||
+    !memcmp(creator, "Lasergraphics Inc.", 18)) {
+    unpadded_10bit = 1;
+    }
+
 // Table 3c: Runs will always break at scan line boundaries. Packing
 // will always break to the next 32-bit word at scan-line boundaries.
 // Unfortunately, the encoder produced invalid files, so attempt
 // to detect it
+    // Also handle special case with unpadded content
 need_align = FFALIGN(stride, 4);
-    if (need_align*avctx->height + (int64_t)offset > avpkt->size) {
+    if (need_align*avctx->height + (int64_t)offset > avpkt->size &&
+    (!unpadded_10bit || (avctx->width * avctx->height * elements + 
2) / 3 * 4 + (int64_t)offset > avpkt->size)) {

 // Alignment seems unappliable, try without
-    if (stride*avctx->height + (int64_t)offset > avpkt->size) {
+    if (stride*avctx->height + (int64_t)offset > avpkt->size || 
unpadded_10bit) {
 av_log(avctx, AV_LOG_ERROR, "Overread buffer. Invalid 
header?\n");

 return AVERROR_INVALIDDATA;
 } else {
@@ -609,20 +625,6 @@ static int decode_frame(AVCodecContext *avctx, 
AVFrame *p,

 if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
 return ret;

-    av_strlcpy(creator, avpkt->data + 160, 100);
-    creator[100] = '\0';
-    av_dict_set(>metadata, "Creator", creator, 0);
-
-    av_strlcpy(input_device, avpkt->data + 1556, 32);
-    input_device[32] = '\0';
-    av_dict_set(>metadata, "Input Device", input_device, 0);
-
-    // Some devices do not pad 10bit samples to whole 32bit words per row
-    if (!memcmp(input_device, "Scanity", 7) ||
-    !memcmp(creator, "Lasergraphics Inc.", 18)) {
-    unpadded_10bit = 1;
-    }
-
 // Move pointer to offset from start of file
 buf =  avpkt->data + offset;

--
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] lavc/pthread_frame: set worker thread names

2022-10-19 Thread Anton Khirnov
---
Yes, the space is limited and we could bikeshed until christmas about
the best way to use it.

Here's an attempt with an 'av' prefix, 'ft' (frame thread) changed to
df (decoder - frame thread), and only two characters guranteed for
thread index.
---
 libavcodec/pthread_frame.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index f8fddc5e4d..df82a4125f 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -179,6 +179,17 @@ static void async_unlock(FrameThreadContext *fctx)
 pthread_mutex_unlock(>async_mutex);
 }
 
+static void thread_set_name(PerThreadContext *p)
+{
+AVCodecContext *avctx = p->avctx;
+int idx = p - p->parent->threads;
+char name[16];
+
+snprintf(name, sizeof(name), "av:%.7s:df%d", avctx->codec->name, idx);
+
+ff_thread_setname(name);
+}
+
 /**
  * Codec worker thread.
  *
@@ -192,6 +203,8 @@ static attribute_align_arg void *frame_worker_thread(void 
*arg)
 AVCodecContext *avctx = p->avctx;
 const FFCodec *codec = ffcodec(avctx->codec);
 
+thread_set_name(p);
+
 pthread_mutex_lock(>mutex);
 while (1) {
 while (atomic_load(>state) == STATE_INPUT_READY && !p->die)
-- 
2.35.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] configure: Remove a leftover comment about MSVC C99 support

2022-10-19 Thread Martin Storsjö
Support for building with older versions of MSVC (with the
c99wrap/c99conv frontend) was removed in
ce943dd6acbfdfc40223c0fb24d4cad438e6499c.

Signed-off-by: Martin Storsjö 
---
 configure | 6 --
 1 file changed, 6 deletions(-)

diff --git a/configure b/configure
index 6712d045d9..ed52212f93 100755
--- a/configure
+++ b/configure
@@ -4368,12 +4368,6 @@ case "$toolchain" in
 esac
 ;;
 msvc)
-# Check whether the current MSVC version needs the C99 converter.
-# From MSVC 2013 (compiler major version 18) onwards, it does actually
-# support enough of C99 to build ffmpeg. Default to the new
-# behaviour if the regexp was unable to match anything, since this
-# successfully parses the version number of existing supported
-# versions that require the converter (MSVC 2010 and 2012).
 cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version 
\([[:digit:]]\{1,\}\)\..*/\1/p')
 if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
 cc_default="cl.exe"
-- 
2.37.0 (Apple Git-136)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v4] avformat/hls: Add option to retry failed segments for hls

2022-10-19 Thread gnattu
Current HLS implementation simply skip a failed segment to catch up
the stream, but this is not optimal for some use cases like livestream
recording.
Add an option to retry a failed segment to ensure the output file is
a complete stream.

Signed-off-by: gnattu 
---
v4 added documentation for the new seg_max_try option

 doc/demuxers.texi |  4 
 libavformat/hls.c | 15 ++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 2b6dd86c2a..3e09a0f14e 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -401,6 +401,10 @@ Use HTTP partial requests for downloading HTTP segments.
 
 @item seg_format_options
 Set options for the demuxer of media segments using a list of key=value pairs 
separated by @code{:}.
+
+@item seg_max_retry
+Maximum number of times to reload a segment on error, useful when segment skip 
on network error is not desired.
+Default value is 0.
 @end table
 
 @section image2
diff --git a/libavformat/hls.c b/libavformat/hls.c
index e622425e80..2b977f9132 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -225,6 +225,7 @@ typedef struct HLSContext {
 int http_persistent;
 int http_multiple;
 int http_seekable;
+int seg_max_retry;
 AVIOContext *playlist_pb;
 HLSCryptoContext  crypto_ctx;
 } HLSContext;
@@ -1472,6 +1473,7 @@ static int read_data(void *opaque, uint8_t *buf, int 
buf_size)
 int ret;
 int just_opened = 0;
 int reload_count = 0;
+int segment_retries = 0;
 struct segment *seg;
 
 restart:
@@ -1563,9 +1565,18 @@ reload:
 av_log(v->parent, AV_LOG_WARNING, "Failed to open segment 
%"PRId64" of playlist %d\n",
v->cur_seq_no,
v->index);
-v->cur_seq_no += 1;
+if (segment_retries >= c->seg_max_retry) {
+av_log(v->parent, AV_LOG_WARNING, "Segment %"PRId64" of 
playlist %d failed too many times, skipping\n",
+   v->cur_seq_no,
+   v->index);
+v->cur_seq_no += 1;
+segment_retries = 0;
+} else {
+segment_retries += 1;
+}
 goto reload;
 }
+segment_retries = 0;
 just_opened = 1;
 }
 
@@ -2549,6 +2560,8 @@ static const AVOption hls_options[] = {
 OFFSET(http_seekable), AV_OPT_TYPE_BOOL, { .i64 = -1}, -1, 1, FLAGS},
 {"seg_format_options", "Set options for segment demuxer",
 OFFSET(seg_format_opts), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, FLAGS},
+{"seg_max_retry", "Maximum number of times to reload a segment on error.",
+ OFFSET(seg_max_retry), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS},
 {NULL}
 };
 
-- 
2.37.0 (Apple Git-136)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v1 08/11] avcodec: add external decoder libvvdec for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

Add external decoder VVdeC for H266/VVC decoding.
Register new decoder libvvdec
Add vvc_parse_extradata to support parse/probe of vvcC stream input
Add vvc_paramset that implements the parser of vvcC configuration boxes
Add libvvdec to wrap the vvdec interface into ffmpeg
libvvdec implements decoder option externmem to use AVBufferPool (default) or 
copy image after receiving from decoder
Enable decoder by adding --enable-libvvdec in configure step

Signed-off-by: Thomas Siedel 
---
 configure|   5 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libvvdec.c| 511 
 libavcodec/vvc_paramset.c| 972 +++
 libavcodec/vvc_paramset.h| 429 ++
 libavcodec/vvc_parse_extradata.c | 241 
 libavcodec/vvc_parse_extradata.h |  36 ++
 8 files changed, 2196 insertions(+)
 create mode 100644 libavcodec/libvvdec.c
 create mode 100644 libavcodec/vvc_paramset.c
 create mode 100644 libavcodec/vvc_paramset.h
 create mode 100644 libavcodec/vvc_parse_extradata.c
 create mode 100644 libavcodec/vvc_parse_extradata.h

diff --git a/configure b/configure
index 30df2cb0a4..289473782c 100755
--- a/configure
+++ b/configure
@@ -288,6 +288,7 @@ External library support:
   --enable-libvorbis   enable Vorbis en/decoding via libvorbis,
native implementation exists [no]
   --enable-libvpx  enable VP8 and VP9 de/encoding via libvpx [no]
+  --enable-libvvdecenable VVC decoding via vvdec [no]
   --enable-libwebp enable WebP encoding via libwebp [no]
   --enable-libx264 enable H.264 encoding via x264 [no]
   --enable-libx265 enable HEVC encoding via x265 [no]
@@ -1875,6 +1876,7 @@ EXTERNAL_LIBRARY_LIST="
 libvmaf
 libvorbis
 libvpx
+libvvdec
 libwebp
 libxml2
 libzimg
@@ -3402,6 +3404,8 @@ libvpx_vp8_decoder_deps="libvpx"
 libvpx_vp8_encoder_deps="libvpx"
 libvpx_vp9_decoder_deps="libvpx"
 libvpx_vp9_encoder_deps="libvpx"
+libvvdec_decoder_deps="libvvdec"
+libvvdec_decoder_select="vvc_mp4toannexb_bsf"
 libwebp_encoder_deps="libwebp"
 libwebp_anim_encoder_deps="libwebp"
 libx262_encoder_deps="libx262"
@@ -6731,6 +6735,7 @@ enabled libvpx&& {
 die "libvpx enabled but no supported decoders found"
 fi
 }
+enabled libvvdec  && require_pkg_config libvvdec "libvvdec >= 1.6.0" 
"vvdec/vvdec.h" vvdec_get_version
 
 enabled libwebp   && {
 enabled libwebp_encoder  && require_pkg_config libwebp "libwebp >= 
0.2.0" webp/encode.h WebPGetEncoderVersion
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 53a8dc67cb..3cc258351c 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1102,6 +1102,7 @@ OBJS-$(CONFIG_LIBVPX_VP8_DECODER) += libvpxdec.o
 OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o
 OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o libvpx.o
 OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o libvpx.o
+OBJS-$(CONFIG_LIBVVDEC_DECODER)   += libvvdec.o vvc_parse_extradata.o 
vvc_paramset.o
 OBJS-$(CONFIG_LIBWEBP_ENCODER)+= libwebpenc_common.o libwebpenc.o
 OBJS-$(CONFIG_LIBWEBP_ANIM_ENCODER)   += libwebpenc_common.o 
libwebpenc_animencoder.o
 OBJS-$(CONFIG_LIBX262_ENCODER)+= libx264.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 46ad3b5a25..58cf993785 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -793,6 +793,7 @@ extern const FFCodec ff_libvpx_vp8_encoder;
 extern const FFCodec ff_libvpx_vp8_decoder;
 extern FFCodec ff_libvpx_vp9_encoder;
 extern FFCodec ff_libvpx_vp9_decoder;
+extern const FFCodec ff_libvvdec_decoder;
 /* preferred over libwebp */
 extern const FFCodec ff_libwebp_anim_encoder;
 extern const FFCodec ff_libwebp_encoder;
diff --git a/libavcodec/libvvdec.c b/libavcodec/libvvdec.c
new file mode 100644
index 00..28f3a548ca
--- /dev/null
+++ b/libavcodec/libvvdec.c
@@ -0,0 +1,511 @@
+/*
+ * H.266 decoding using the VVdeC library
+ *
+ * Copyright (C) 2022, Thomas Siedel
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config_components.h"
+
+#include 
+

[FFmpeg-devel] [PATCH v1 09/11] avcodec: add external encoder libvvenc for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

Add external encoder VVenC for H266/VVC encoding.
Register new encoder libvvencc
Add libvvenc to wrap the vvenc interface into ffmpeg
libvvenc implements encoder option: 
preset,qp,period,subjopt,vvenc-params,levelidc,tier
Enable encoder by adding --enable-libvvenc in configure step

Signed-off-by: Thomas Siedel 
---
 configure  |   5 +
 libavcodec/Makefile|   1 +
 libavcodec/allcodecs.c |   1 +
 libavcodec/libvvenc.c  | 432 +
 4 files changed, 439 insertions(+)
 create mode 100644 libavcodec/libvvenc.c

diff --git a/configure b/configure
index 289473782c..ff85d2921b 100755
--- a/configure
+++ b/configure
@@ -289,6 +289,7 @@ External library support:
native implementation exists [no]
   --enable-libvpx  enable VP8 and VP9 de/encoding via libvpx [no]
   --enable-libvvdecenable VVC decoding via vvdec [no]
+  --enable-libvvencenable VVC encoding via vvenc [no]
   --enable-libwebp enable WebP encoding via libwebp [no]
   --enable-libx264 enable H.264 encoding via x264 [no]
   --enable-libx265 enable HEVC encoding via x265 [no]
@@ -1877,6 +1878,7 @@ EXTERNAL_LIBRARY_LIST="
 libvorbis
 libvpx
 libvvdec
+libvvenc
 libwebp
 libxml2
 libzimg
@@ -3406,6 +3408,8 @@ libvpx_vp9_decoder_deps="libvpx"
 libvpx_vp9_encoder_deps="libvpx"
 libvvdec_decoder_deps="libvvdec"
 libvvdec_decoder_select="vvc_mp4toannexb_bsf"
+libvvenc_encoder_deps="libvvenc"
+libvvenc_encoder_select="atsc_a53"
 libwebp_encoder_deps="libwebp"
 libwebp_anim_encoder_deps="libwebp"
 libx262_encoder_deps="libx262"
@@ -6736,6 +6740,7 @@ enabled libvpx&& {
 fi
 }
 enabled libvvdec  && require_pkg_config libvvdec "libvvdec >= 1.6.0" 
"vvdec/vvdec.h" vvdec_get_version
+enabled libvvenc  && require_pkg_config libvvenc "libvvenc >= 1.6.1" 
"vvenc/vvenc.h" vvenc_get_version
 
 enabled libwebp   && {
 enabled libwebp_encoder  && require_pkg_config libwebp "libwebp >= 
0.2.0" webp/encode.h WebPGetEncoderVersion
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 3cc258351c..4bc1a84260 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1103,6 +1103,7 @@ OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o
 OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o libvpx.o
 OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o libvpx.o
 OBJS-$(CONFIG_LIBVVDEC_DECODER)   += libvvdec.o vvc_parse_extradata.o 
vvc_paramset.o
+OBJS-$(CONFIG_LIBVVENC_ENCODER)   += libvvenc.o
 OBJS-$(CONFIG_LIBWEBP_ENCODER)+= libwebpenc_common.o libwebpenc.o
 OBJS-$(CONFIG_LIBWEBP_ANIM_ENCODER)   += libwebpenc_common.o 
libwebpenc_animencoder.o
 OBJS-$(CONFIG_LIBX262_ENCODER)+= libx264.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 58cf993785..f62c3cf902 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -794,6 +794,7 @@ extern const FFCodec ff_libvpx_vp8_decoder;
 extern FFCodec ff_libvpx_vp9_encoder;
 extern FFCodec ff_libvpx_vp9_decoder;
 extern const FFCodec ff_libvvdec_decoder;
+extern const FFCodec ff_libvvenc_encoder;
 /* preferred over libwebp */
 extern const FFCodec ff_libwebp_anim_encoder;
 extern const FFCodec ff_libwebp_encoder;
diff --git a/libavcodec/libvvenc.c b/libavcodec/libvvenc.c
new file mode 100644
index 00..5a9412814c
--- /dev/null
+++ b/libavcodec/libvvenc.c
@@ -0,0 +1,432 @@
+/*
+ * H.266 encoding using the VVenC library
+ *
+ * Copyright (C) 2022, Thomas Siedel
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config_components.h"
+
+#include 
+#include 
+
+#include "avcodec.h"
+#include "codec_internal.h"
+#include "encode.h"
+#include "internal.h"
+#include "packet_internal.h"
+#include "profiles.h"
+
+#include "libavutil/avutil.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
+#include "libavutil/common.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/frame.h"
+#include "libavutil/log.h"
+
+typedef struct VVenCOptions {
+int preset; // preset 0: faster  4: slower
+int qp; // quantization parameter 0-63
+int 

[FFmpeg-devel] [PATCH v1 07/11] avformat: add muxer support for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

Add muxer for vvcc byte stream format.
Add AV_CODEC_ID_VVC to ff_mp4_obj_type
Add AV_CODEC_ID_VVC to ISO Media codec (VvcConfigurationBox vvi1, vvc1 defined 
in ISO/IEC 14496-15:2021)
Add VvcConfigurationBox vvcC which extends FullBox type in ISO/IEC 14496-15:2021
Add ff_vvc_muxer to RAW muxers

Signed-off-by: Thomas Siedel 
---
 libavformat/Makefile |  7 ---
 libavformat/allformats.c |  1 +
 libavformat/isom.c   |  1 +
 libavformat/isom_tags.c  |  3 +++
 libavformat/mov.c|  6 ++
 libavformat/movenc.c | 41 +++-
 libavformat/rawenc.c | 23 ++
 7 files changed, 78 insertions(+), 4 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 00ab4ded89..9ee2526eef 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -336,7 +336,7 @@ OBJS-$(CONFIG_MATROSKA_DEMUXER)  += matroskadec.o 
matroska.o  \
 oggparsevorbis.o vorbiscomment.o \
 qtpalette.o replaygain.o 
dovi_isom.o
 OBJS-$(CONFIG_MATROSKA_MUXER)+= matroskaenc.o matroska.o \
-av1.o avc.o hevc.o \
+av1.o avc.o hevc.o vvc.o\
 flacenc_header.o avlanguage.o \
 vorbiscomment.o wv.o dovi_isom.o
 OBJS-$(CONFIG_MCA_DEMUXER)   += mca.o
@@ -358,7 +358,7 @@ OBJS-$(CONFIG_MODS_DEMUXER)  += mods.o
 OBJS-$(CONFIG_MOFLEX_DEMUXER)+= moflex.o
 OBJS-$(CONFIG_MOV_DEMUXER)   += mov.o mov_chan.o mov_esds.o \
 qtpalette.o replaygain.o 
dovi_isom.o
-OBJS-$(CONFIG_MOV_MUXER) += movenc.o av1.o avc.o hevc.o vpcc.o 
\
+OBJS-$(CONFIG_MOV_MUXER) += movenc.o av1.o avc.o hevc.o vvc.o 
vpcc.o \
 movenchint.o mov_chan.o rtp.o \
 movenccenc.o movenc_ttml.o 
rawutils.o \
 dovi_isom.o
@@ -508,7 +508,7 @@ OBJS-$(CONFIG_RTP_MUXER) += rtp.o \
 rtpenc_vp8.o  \
 rtpenc_vp9.o\
 rtpenc_xiph.o \
-avc.o hevc.o
+avc.o hevc.o vvc.o
 OBJS-$(CONFIG_RTSP_DEMUXER)  += rtsp.o rtspdec.o httpauth.o \
 urldecode.o
 OBJS-$(CONFIG_RTSP_MUXER)+= rtsp.o rtspenc.o httpauth.o \
@@ -596,6 +596,7 @@ OBJS-$(CONFIG_VPK_DEMUXER)   += vpk.o
 OBJS-$(CONFIG_VPLAYER_DEMUXER)   += vplayerdec.o subtitles.o
 OBJS-$(CONFIG_VQF_DEMUXER)   += vqf.o
 OBJS-$(CONFIG_VVC_DEMUXER)   += vvcdec.o rawdec.o
+OBJS-$(CONFIG_VVC_MUXER) += rawenc.o
 OBJS-$(CONFIG_W64_DEMUXER)   += wavdec.o w64.o pcm.o
 OBJS-$(CONFIG_W64_MUXER) += wavenc.o w64.o
 OBJS-$(CONFIG_WAV_DEMUXER)   += wavdec.o pcm.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index a4e3822681..006a7dc125 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -475,6 +475,7 @@ extern const AVInputFormat  ff_vpk_demuxer;
 extern const AVInputFormat  ff_vplayer_demuxer;
 extern const AVInputFormat  ff_vqf_demuxer;
 extern const AVInputFormat  ff_vvc_demuxer;
+extern const AVOutputFormat ff_vvc_muxer;
 extern const AVInputFormat  ff_w64_demuxer;
 extern const AVOutputFormat ff_w64_muxer;
 extern const AVInputFormat  ff_wav_demuxer;
diff --git a/libavformat/isom.c b/libavformat/isom.c
index 6d019881e5..9fbccd4437 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -36,6 +36,7 @@ const AVCodecTag ff_mp4_obj_type[] = {
 { AV_CODEC_ID_MPEG4   , 0x20 },
 { AV_CODEC_ID_H264, 0x21 },
 { AV_CODEC_ID_HEVC, 0x23 },
+{ AV_CODEC_ID_VVC , 0x33 },
 { AV_CODEC_ID_AAC , 0x40 },
 { AV_CODEC_ID_MP4ALS  , 0x40 }, /* 14496-3 ALS */
 { AV_CODEC_ID_MPEG2VIDEO  , 0x61 }, /* MPEG-2 Main */
diff --git a/libavformat/isom_tags.c b/libavformat/isom_tags.c
index e2b80405cc..ec93bdc363 100644
--- a/libavformat/isom_tags.c
+++ b/libavformat/isom_tags.c
@@ -123,6 +123,9 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
 { AV_CODEC_ID_HEVC, MKTAG('d', 'v', 'h', 'e') }, /* HEVC-based Dolby 
Vision derived from hev1 */
  /* dvh1 is handled within 
mov.c */
 
+{ AV_CODEC_ID_VVC, MKTAG('v', 'v', 'i', '1') },  /* VVC/H.266 which 
indicates parameter sets may be in ES */
+{ AV_CODEC_ID_VVC, MKTAG('v', 'v', 'c', '1') },  /* VVC/H.266 which 
indicates parameter shall 

[FFmpeg-devel] [PATCH v1 06/11] avformat: add demuxer and probe support for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

Add demuxer to probe raw vvc and parse vvcc byte stream format.

Signed-off-by: Thomas Siedel 
---
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/demux.c  |   7 +-
 libavformat/vvc.c| 918 +++
 libavformat/vvc.h|  99 +
 libavformat/vvcdec.c |  61 +++
 6 files changed, 1085 insertions(+), 2 deletions(-)
 create mode 100644 libavformat/vvc.c
 create mode 100644 libavformat/vvc.h
 create mode 100644 libavformat/vvcdec.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index d7f198bf39..00ab4ded89 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -595,6 +595,7 @@ OBJS-$(CONFIG_VOC_MUXER) += vocenc.o voc.o
 OBJS-$(CONFIG_VPK_DEMUXER)   += vpk.o
 OBJS-$(CONFIG_VPLAYER_DEMUXER)   += vplayerdec.o subtitles.o
 OBJS-$(CONFIG_VQF_DEMUXER)   += vqf.o
+OBJS-$(CONFIG_VVC_DEMUXER)   += vvcdec.o rawdec.o
 OBJS-$(CONFIG_W64_DEMUXER)   += wavdec.o w64.o pcm.o
 OBJS-$(CONFIG_W64_MUXER) += wavenc.o w64.o
 OBJS-$(CONFIG_WAV_DEMUXER)   += wavdec.o pcm.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 47c419a009..a4e3822681 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -474,6 +474,7 @@ extern const AVOutputFormat ff_voc_muxer;
 extern const AVInputFormat  ff_vpk_demuxer;
 extern const AVInputFormat  ff_vplayer_demuxer;
 extern const AVInputFormat  ff_vqf_demuxer;
+extern const AVInputFormat  ff_vvc_demuxer;
 extern const AVInputFormat  ff_w64_demuxer;
 extern const AVOutputFormat ff_w64_muxer;
 extern const AVInputFormat  ff_wav_demuxer;
diff --git a/libavformat/demux.c b/libavformat/demux.c
index 2dfd82a63c..8dbde23fcd 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -120,6 +120,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, 
AVStream *st,
 { "mp3",AV_CODEC_ID_MP3,  AVMEDIA_TYPE_AUDIO},
 { "mpegvideo",  AV_CODEC_ID_MPEG2VIDEO,   AVMEDIA_TYPE_VIDEO},
 { "truehd", AV_CODEC_ID_TRUEHD,   AVMEDIA_TYPE_AUDIO},
+{ "vvc",AV_CODEC_ID_VVC,  AVMEDIA_TYPE_VIDEO},
 { 0 }
 };
 int score;
@@ -743,7 +744,8 @@ static int64_t select_from_pts_buffer(AVStream *st, int64_t 
*pts_buffer, int64_t
 {
 FFStream *const sti = ffstream(st);
 int onein_oneout = st->codecpar->codec_id != AV_CODEC_ID_H264 &&
-   st->codecpar->codec_id != AV_CODEC_ID_HEVC;
+   st->codecpar->codec_id != AV_CODEC_ID_HEVC &&
+   st->codecpar->codec_id != AV_CODEC_ID_VVC;
 
 if (!onein_oneout) {
 int delay = sti->avctx->has_b_frames;
@@ -933,7 +935,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream 
*st,
 int64_t offset;
 AVRational duration;
 int onein_oneout = st->codecpar->codec_id != AV_CODEC_ID_H264 &&
-   st->codecpar->codec_id != AV_CODEC_ID_HEVC;
+   st->codecpar->codec_id != AV_CODEC_ID_HEVC &&
+   st->codecpar->codec_id != AV_CODEC_ID_VVC;
 
 if (s->flags & AVFMT_FLAG_NOFILLIN)
 return;
diff --git a/libavformat/vvc.c b/libavformat/vvc.c
new file mode 100644
index 00..fd0527242f
--- /dev/null
+++ b/libavformat/vvc.c
@@ -0,0 +1,918 @@
+/*
+ * VVC helper functions for muxers
+ *
+ * Copyright (C) 2022, Thomas Siedel
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavcodec/get_bits.h"
+#include "libavcodec/golomb.h"
+#include "libavcodec/vvc.h"
+#include "libavutil/intreadwrite.h"
+#include "avc.h"
+#include "avio.h"
+#include "avio_internal.h"
+#include "vvc.h"
+
+typedef struct VVCCNALUnitArray {
+uint8_t  array_completeness;
+uint8_t  NAL_unit_type;
+uint16_t num_nalus;
+uint16_t *nal_unit_length;
+uint8_t  **nal_unit;
+} VVCCNALUnitArray;
+
+typedef struct VVCPTLRecord {
+uint8_t  num_bytes_constraint_info;
+uint8_t  general_profile_idc;
+uint8_t  general_tier_flag;
+uint8_t  general_level_idc;
+uint8_t  ptl_frame_only_constraint_flag;
+uint8_t  ptl_multilayer_enabled_flag;
+uint8_t  

[FFmpeg-devel] [PATCH v1 11/11] avcodec: increase minor version for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

Increase avcodec minor version for vvc support.

Signed-off-by: Thomas Siedel 
---
 libavcodec/version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/version.h b/libavcodec/version.h
index f8abc803b6..86ac0f3871 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #include "version_major.h"
 
-#define LIBAVCODEC_VERSION_MINOR  51
+#define LIBAVCODEC_VERSION_MINOR  52
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v1 10/11] avformat: add ts stream types for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

Add transport stream stream type 0x33 for vvc.
Add STREAM_TYPE_VIDEO_VVC to MPEG-1/2 and MPEG-2 transport stream
Add basic transport stream support for TS mux/demux

Signed-off-by: Thomas Siedel 
---
 configure   |  2 +-
 libavformat/mpeg.c  |  3 ++
 libavformat/mpeg.h  |  1 +
 libavformat/mpegts.c|  2 ++
 libavformat/mpegts.h|  1 +
 libavformat/mpegtsenc.c | 65 +
 6 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index ff85d2921b..10a723eff9 100755
--- a/configure
+++ b/configure
@@ -3482,7 +3482,7 @@ mp3_demuxer_select="mpegaudio_parser"
 mp3_muxer_select="mpegaudioheader"
 mp4_muxer_select="mov_muxer"
 mpegts_demuxer_select="iso_media"
-mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf 
hevc_mp4toannexb_bsf"
+mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf 
hevc_mp4toannexb_bsf vvc_mp4toannexb_bsf"
 mpegtsraw_demuxer_select="mpegts_demuxer"
 mxf_muxer_select="pcm_rechunk_bsf"
 mxf_d10_muxer_select="mxf_muxer"
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 864b08d8f8..970926df6b 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -546,6 +546,9 @@ redo:
 } else if (es_type == STREAM_TYPE_VIDEO_HEVC) {
 codec_id = AV_CODEC_ID_HEVC;
 type = AVMEDIA_TYPE_VIDEO;
+} else if (es_type == STREAM_TYPE_VIDEO_VVC) {
+codec_id = AV_CODEC_ID_VVC;
+type = AVMEDIA_TYPE_VIDEO;
 } else if (es_type == STREAM_TYPE_AUDIO_AC3) {
 codec_id = AV_CODEC_ID_AC3;
 type = AVMEDIA_TYPE_AUDIO;
diff --git a/libavformat/mpeg.h b/libavformat/mpeg.h
index b635295776..20592eb184 100644
--- a/libavformat/mpeg.h
+++ b/libavformat/mpeg.h
@@ -56,6 +56,7 @@
 #define STREAM_TYPE_VIDEO_MPEG4 0x10
 #define STREAM_TYPE_VIDEO_H264  0x1b
 #define STREAM_TYPE_VIDEO_HEVC  0x24
+#define STREAM_TYPE_VIDEO_VVC   0x33
 #define STREAM_TYPE_VIDEO_CAVS  0x42
 
 #define STREAM_TYPE_AUDIO_AC3   0x81
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index d97702fcd7..61a800c85f 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -811,6 +811,7 @@ static const StreamType ISO_types[] = {
 { 0x20, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264   },
 { 0x21, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_JPEG2000   },
 { 0x24, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_HEVC   },
+{ 0x33, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_VVC},
 { 0x42, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_CAVS   },
 { 0xd1, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_DIRAC  },
 { 0xd2, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_AVS2   },
@@ -865,6 +866,7 @@ static const StreamType REGD_types[] = {
 { MKTAG('D', 'T', 'S', '3'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS   },
 { MKTAG('E', 'A', 'C', '3'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_EAC3  },
 { MKTAG('H', 'E', 'V', 'C'), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_HEVC  },
+{ MKTAG('V', 'V', 'C', ' '), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_VVC   },
 { MKTAG('K', 'L', 'V', 'A'), AVMEDIA_TYPE_DATA,  AV_CODEC_ID_SMPTE_KLV },
 { MKTAG('I', 'D', '3', ' '), AVMEDIA_TYPE_DATA,  AV_CODEC_ID_TIMED_ID3 },
 { MKTAG('V', 'C', '-', '1'), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_VC1   },
diff --git a/libavformat/mpegts.h b/libavformat/mpegts.h
index a48f14e768..14ae312c50 100644
--- a/libavformat/mpegts.h
+++ b/libavformat/mpegts.h
@@ -128,6 +128,7 @@
 #define STREAM_TYPE_METADATA0x15
 #define STREAM_TYPE_VIDEO_H264  0x1b
 #define STREAM_TYPE_VIDEO_HEVC  0x24
+#define STREAM_TYPE_VIDEO_VVC   0x33
 #define STREAM_TYPE_VIDEO_CAVS  0x42
 #define STREAM_TYPE_VIDEO_AVS2  0xd2
 #define STREAM_TYPE_VIDEO_AVS3  0xd4
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 48d39e6a7d..4c32cddff1 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -366,6 +366,9 @@ static int get_dvb_stream_type(AVFormatContext *s, AVStream 
*st)
 case AV_CODEC_ID_HEVC:
 stream_type = STREAM_TYPE_VIDEO_HEVC;
 break;
+case AV_CODEC_ID_VVC:
+stream_type = STREAM_TYPE_VIDEO_VVC;
+break;
 case AV_CODEC_ID_CAVS:
 stream_type = STREAM_TYPE_VIDEO_CAVS;
 break;
@@ -462,6 +465,11 @@ static int get_m2ts_stream_type(AVFormatContext *s, 
AVStream *st)
 case AV_CODEC_ID_HEVC:
 stream_type = STREAM_TYPE_VIDEO_HEVC;
 break;
+case AV_CODEC_ID_VVC:
+av_log(s, AV_LOG_ERROR,
+"MPEGTS VVC %s.\n", avcodec_get_name(st->codecpar->codec_id));
+stream_type = STREAM_TYPE_VIDEO_VVC;
+break;
 case AV_CODEC_ID_PCM_BLURAY:
 stream_type = 0x80;
 break;
@@ -1783,6 +1791,21 @@ static int check_hevc_startcode(AVFormatContext *s, 
const AVStream *st, const AV
 return 0;
 }
 
+static int check_vvc_startcode(AVFormatContext *s, const AVStream *st, const 
AVPacket *pkt)
+{
+if (pkt->size < 5 || AV_RB32(pkt->data) != 0x001 

[FFmpeg-devel] [PATCH v1 05/11] avcodec: add MP4 to annexb support for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

Add parser for VVC MP4 to Annex B byte stream format.

Signed-off-by: Thomas Siedel 
---
 configure|   1 +
 libavcodec/Makefile  |   2 +
 libavcodec/bitstream_filters.c   |   2 +
 libavcodec/h266_metadata_bsf.c   | 145 ++
 libavcodec/vvc_mp4toannexb_bsf.c | 318 +++
 5 files changed, 468 insertions(+)
 create mode 100644 libavcodec/h266_metadata_bsf.c
 create mode 100644 libavcodec/vvc_mp4toannexb_bsf.c

diff --git a/configure b/configure
index 13dca5cd9a..30df2cb0a4 100755
--- a/configure
+++ b/configure
@@ -3298,6 +3298,7 @@ mjpeg2jpeg_bsf_select="jpegtables"
 mpeg2_metadata_bsf_select="cbs_mpeg2"
 trace_headers_bsf_select="cbs"
 vp9_metadata_bsf_select="cbs_vp9"
+vvc_metadata_bsf_select="cbs_h266"
 
 # external libraries
 aac_at_decoder_deps="audiotoolbox"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 3850e316ac..53a8dc67cb 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1222,6 +1222,8 @@ OBJS-$(CONFIG_VP9_METADATA_BSF)   += 
vp9_metadata_bsf.o
 OBJS-$(CONFIG_VP9_RAW_REORDER_BSF)+= vp9_raw_reorder_bsf.o
 OBJS-$(CONFIG_VP9_SUPERFRAME_BSF) += vp9_superframe_bsf.o
 OBJS-$(CONFIG_VP9_SUPERFRAME_SPLIT_BSF)   += vp9_superframe_split_bsf.o
+OBJS-$(CONFIG_VVC_METADATA_BSF)   += h266_metadata_bsf.o
+OBJS-$(CONFIG_VVC_MP4TOANNEXB_BSF)+= vvc_mp4toannexb_bsf.o
 
 # thread libraries
 OBJS-$(HAVE_LIBC_MSVCRT)   += file_open.o
diff --git a/libavcodec/bitstream_filters.c b/libavcodec/bitstream_filters.c
index a3bebefe5f..403884f3d7 100644
--- a/libavcodec/bitstream_filters.c
+++ b/libavcodec/bitstream_filters.c
@@ -64,6 +64,8 @@ extern const FFBitStreamFilter ff_vp9_metadata_bsf;
 extern const FFBitStreamFilter ff_vp9_raw_reorder_bsf;
 extern const FFBitStreamFilter ff_vp9_superframe_bsf;
 extern const FFBitStreamFilter ff_vp9_superframe_split_bsf;
+extern const FFBitStreamFilter ff_vvc_mp4toannexb_bsf;
+extern const FFBitStreamFilter ff_vvc_metadata_bsf;
 
 #include "libavcodec/bsf_list.c"
 
diff --git a/libavcodec/h266_metadata_bsf.c b/libavcodec/h266_metadata_bsf.c
new file mode 100644
index 00..bc3c10f581
--- /dev/null
+++ b/libavcodec/h266_metadata_bsf.c
@@ -0,0 +1,145 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+
+#include "bsf.h"
+#include "bsf_internal.h"
+#include "cbs.h"
+#include "cbs_bsf.h"
+#include "cbs_h266.h"
+#include "vvc.h"
+
+#define IS_SLICE(nut) (nut <= VVC_RASL_NUT || (nut >= VVC_IDR_W_RADL && nut <= 
VVC_GDR_NUT))
+#define IS_PH(nut) (nut == VVC_PH_NUT)
+
+typedef struct VVCMetadataContext {
+CBSBSFContext common;
+
+H266RawAUD aud_nal;
+
+int aud;
+} VVCMetadataContext;
+
+static int h266_metadata_update_fragment(AVBSFContext *bsf, AVPacket *pkt,
+ CodedBitstreamFragment *pu)
+{
+VVCMetadataContext *ctx = bsf->priv_data;
+int err, i;
+
+// If an AUD is present, it must be the first NAL unit.
+if (pu->units[0].type == VVC_AUD_NUT) {
+if (ctx->aud == BSF_ELEMENT_REMOVE)
+ff_cbs_delete_unit(pu, 0);
+} else {
+if (ctx->aud == BSF_ELEMENT_INSERT) {
+const H266RawSlice *first_slice = NULL;
+const H266RawPH*ph = NULL;
+H266RawAUD *aud = >aud_nal;
+int pic_type = 0, temporal_id = 8, layer_id = 0;
+for (i = 0; i < pu->nb_units; i++) {
+const H266RawNALUnitHeader *nal = pu->units[i].content;
+if (!nal)
+continue;
+if (nal->nuh_temporal_id_plus1 < temporal_id + 1)
+temporal_id = nal->nuh_temporal_id_plus1 - 1;
+if (IS_PH(nal->nal_unit_type)) {
+ph = pu->units[i].content;
+} else if(IS_SLICE(nal->nal_unit_type)) {
+const H266RawSlice *slice = pu->units[i].content;
+layer_id = nal->nuh_layer_id;
+if (slice->header.sh_slice_type == VVC_SLICE_TYPE_B &&
+pic_type < 2)
+pic_type = 2;
+if (slice->header.sh_slice_type == 

[FFmpeg-devel] [PATCH v1 04/11] avcodec: add bitstream parser for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

Add nal parser ff_vvc_parser to parse vvc elementary bitstreams.

Signed-off-by: Thomas Siedel 
---
 configure|   3 +
 libavcodec/Makefile  |   1 +
 libavcodec/h2645_parse.c |  71 -
 libavcodec/parsers.c |   1 +
 libavcodec/vvc_parser.c  | 588 +++
 5 files changed, 663 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/vvc_parser.c

diff --git a/configure b/configure
index f3fd91f592..13dca5cd9a 100755
--- a/configure
+++ b/configure
@@ -2446,6 +2446,7 @@ CONFIG_EXTRA="
 cbs_av1
 cbs_h264
 cbs_h265
+cbs_h266
 cbs_jpeg
 cbs_mpeg2
 cbs_vp9
@@ -2727,6 +2728,7 @@ threads_if_any="$THREADS_LIST"
 cbs_av1_select="cbs"
 cbs_h264_select="cbs"
 cbs_h265_select="cbs"
+cbs_h266_select="cbs"
 cbs_jpeg_select="cbs"
 cbs_mpeg2_select="cbs"
 cbs_vp9_select="cbs"
@@ -3278,6 +3280,7 @@ hevc_parser_select="hevcparse"
 mpegaudio_parser_select="mpegaudioheader"
 mpeg4video_parser_select="h263dsp mpegvideodec qpeldsp"
 vc1_parser_select="vc1dsp"
+vvc_parser_select="cbs_h266"
 
 # bitstream_filters
 aac_adtstoasc_bsf_select="adts_header mpeg4audio"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index b3fcf173e9..3850e316ac 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1173,6 +1173,7 @@ OBJS-$(CONFIG_VC1_PARSER)  += vc1_parser.o 
vc1.o vc1data.o  \
 OBJS-$(CONFIG_VP3_PARSER)  += vp3_parser.o
 OBJS-$(CONFIG_VP8_PARSER)  += vp8_parser.o
 OBJS-$(CONFIG_VP9_PARSER)  += vp9_parser.o
+OBJS-$(CONFIG_VVC_PARSER)  += vvc_parser.o
 OBJS-$(CONFIG_WEBP_PARSER) += webp_parser.o
 OBJS-$(CONFIG_XBM_PARSER)  += xbm_parser.o
 OBJS-$(CONFIG_XMA_PARSER)  += xma_parser.o
diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index 90944177c7..9fbeee3edd 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -27,6 +27,7 @@
 #include "libavutil/mem.h"
 
 #include "bytestream.h"
+#include "vvc.h"
 #include "hevc.h"
 #include "h264.h"
 #include "h2645_parse.h"
@@ -145,6 +146,47 @@ nsc:
 return si;
 }
 
+static const char *const vvc_nal_type_name[32] = {
+"TRAIL_NUT", // VVC_TRAIL_NUT
+"STSA_NUT", // VVC_STSA_NUT
+"RADL_NUT", // VVC_RADL_NUT
+"RASL_NUT", // VVC_RASL_NUT
+"RSV_VCL_4", // VVC_RSV_VCL_4
+"RSV_VCL_5", // VVC_RSV_VCL_5
+"RSV_VCL_6", // VVC_RSV_VCL_6
+"IDR_W_RADL", // VVC_IDR_W_RADL
+"IDR_N_LP", // VVC_IDR_N_LP
+"CRA_NUT", // VVC_CRA_NUT
+"GDR_NUT", // VVC_GDR_NUT
+"RSV_IRAP_11", // VVC_RSV_IRAP_11
+"OPI_NUT", // VVC_OPI_NUT
+"DCI_NUT", // VVC_DCI_NUT
+"VPS_NUT", // VVC_VPS_NUT
+"SPS_NUT", // VVC_SPS_NUT
+"PPS_NUT", // VVC_PPS_NUT
+"PREFIX_APS_NUT",// VVC_PREFIX_APS_NUT
+"SUFFIX_APS_NUT",// VVC_SUFFIX_APS_NUT
+"PH_NUT", // VVC_PH_NUT
+"AUD_NUT", // VVC_AUD_NUT
+"EOS_NUT", // VVC_EOS_NUT
+"EOB_NUT", // VVC_EOB_NUT
+"PREFIX_SEI_NUT",// VVC_PREFIX_SEI_NUT
+"SUFFIX_SEI_NUT",// VVC_SUFFIX_SEI_NUT
+"FD_NUT", // VVC_FD_NUT
+"RSV_NVCL_26", // VVC_RSV_NVCL_26
+"RSV_NVCL_27", // VVC_RSV_NVCL_27
+"UNSPEC_28", // VVC_UNSPEC_28
+"UNSPEC_29", // VVC_UNSPEC_29
+"UNSPEC_30", // VVC_UNSPEC_30
+"UNSPEC_31", // VVC_UNSPEC_31
+};
+
+static const char *vvc_nal_unit_name(int nal_type)
+{
+av_assert0(nal_type >= 0 && nal_type < 32);
+return vvc_nal_type_name[nal_type];
+}
+
 static const char *const hevc_nal_type_name[64] = {
 "TRAIL_N", // HEVC_NAL_TRAIL_N
 "TRAIL_R", // HEVC_NAL_TRAIL_R
@@ -293,6 +335,31 @@ static int get_bit_length(H2645NAL *nal, int min_size, int 
skip_trailing_zeros)
  * @return AVERROR_INVALIDDATA if the packet is not a valid NAL unit,
  * 0 otherwise
  */
+static int vvc_parse_nal_header(H2645NAL *nal, void *logctx)
+{
+GetBitContext *gb = >gb;
+
+if (get_bits1(gb) != 0) //forbidden_zero_bit
+return AVERROR_INVALIDDATA;
+
+skip_bits1(gb); //nuh_reserved_zero_bit
+
+nal->nuh_layer_id = get_bits(gb, 6);
+nal->type = get_bits(gb, 5);
+nal->temporal_id = get_bits(gb, 3) - 1;
+if (nal->temporal_id < 0)
+return AVERROR_INVALIDDATA;
+
+if ((nal->type >= VVC_IDR_W_RADL && nal->type <= VVC_RSV_IRAP_11) && 
nal->temporal_id)
+return AVERROR_INVALIDDATA;
+
+av_log(logctx, AV_LOG_DEBUG,
+  "nal_unit_type: %d(%s), nuh_layer_id: %d, temporal_id: %d\n",
+   nal->type, vvc_nal_unit_name(nal->type), nal->nuh_layer_id, 
nal->temporal_id);
+
+return 0;
+}
+
 static int hevc_parse_nal_header(H2645NAL *nal, void *logctx)
 {
 GetBitContext *gb = >gb;
@@ -509,7 +576,9 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t 
*buf, int length,
 /* Reset type in case it contains a stale value from a previously 
parsed NAL */
 nal->type = 0;
 
-if (codec_id == AV_CODEC_ID_HEVC)
+if (codec_id == AV_CODEC_ID_VVC)
+

[FFmpeg-devel] [PATCH v1 03/11] avcodec: enable cbs for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

Add ff_cbs_type_h266 to cbs types tables and AV_CODEC_ID_H266 to cbs codec ids.
Change CBS_MAX_UNIT_TYPES to 8 as VVC implements 8 different slice types

Signed-off-by: Thomas Siedel 
---
 libavcodec/Makefile   | 1 +
 libavcodec/cbs.c  | 6 ++
 libavcodec/cbs_internal.h | 3 ++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c7dc5da0f9..b3fcf173e9 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -76,6 +76,7 @@ OBJS-$(CONFIG_CBS) += cbs.o cbs_bsf.o
 OBJS-$(CONFIG_CBS_AV1) += cbs_av1.o
 OBJS-$(CONFIG_CBS_H264)+= cbs_h2645.o cbs_sei.o h2645_parse.o
 OBJS-$(CONFIG_CBS_H265)+= cbs_h2645.o cbs_sei.o h2645_parse.o
+OBJS-$(CONFIG_CBS_H266)+= cbs_h2645.o cbs_sei.o h2645_parse.o
 OBJS-$(CONFIG_CBS_JPEG)+= cbs_jpeg.o
 OBJS-$(CONFIG_CBS_MPEG2)   += cbs_mpeg2.o
 OBJS-$(CONFIG_CBS_VP9) += cbs_vp9.o
diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c
index 8d6e3c3442..f01726aa37 100644
--- a/libavcodec/cbs.c
+++ b/libavcodec/cbs.c
@@ -40,6 +40,9 @@ static const CodedBitstreamType *const cbs_type_table[] = {
 #if CONFIG_CBS_H265
 _cbs_type_h265,
 #endif
+#if CONFIG_CBS_H266
+_cbs_type_h266,
+#endif
 #if CONFIG_CBS_JPEG
 _cbs_type_jpeg,
 #endif
@@ -61,6 +64,9 @@ const enum AVCodecID ff_cbs_all_codec_ids[] = {
 #if CONFIG_CBS_H265
 AV_CODEC_ID_H265,
 #endif
+#if CONFIG_CBS_H266
+AV_CODEC_ID_H266,
+#endif
 #if CONFIG_CBS_JPEG
 AV_CODEC_ID_MJPEG,
 #endif
diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h
index 5ccba3c901..b741030da4 100644
--- a/libavcodec/cbs_internal.h
+++ b/libavcodec/cbs_internal.h
@@ -45,7 +45,7 @@ enum CBSContentType {
 enum {
   // Maximum number of unit types described by the same unit type
   // descriptor.
-  CBS_MAX_UNIT_TYPES  = 3,
+  CBS_MAX_UNIT_TYPES  = 8,
   // Maximum number of reference buffer offsets in any one unit.
   CBS_MAX_REF_OFFSETS = 2,
   // Special value used in a unit type descriptor to indicate that it
@@ -242,6 +242,7 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, 
PutBitContext *pbc,
 extern const CodedBitstreamType ff_cbs_type_av1;
 extern const CodedBitstreamType ff_cbs_type_h264;
 extern const CodedBitstreamType ff_cbs_type_h265;
+extern const CodedBitstreamType ff_cbs_type_h266;
 extern const CodedBitstreamType ff_cbs_type_jpeg;
 extern const CodedBitstreamType ff_cbs_type_mpeg2;
 extern const CodedBitstreamType ff_cbs_type_vp9;
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v1 01/11] avcodec: add enum types for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

Add needed types as nal unit types, slice types and vvc typedefs needed for 
parsing vvc high-level syntax

Signed-off-by: Thomas Siedel 
---
 libavcodec/vvc.h | 142 +++
 1 file changed, 142 insertions(+)
 create mode 100644 libavcodec/vvc.h

diff --git a/libavcodec/vvc.h b/libavcodec/vvc.h
new file mode 100644
index 00..19979b7017
--- /dev/null
+++ b/libavcodec/vvc.h
@@ -0,0 +1,142 @@
+/*
+ * VVC shared code
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VVC_H
+#define AVCODEC_VVC_H
+
+/**
+ * Table 5 – NAL unit type codes and NAL unit type classes
+ * in T-REC-H.266-202008
+ */
+enum VVCNALUnitType {
+VVC_TRAIL_NUT  = 0,
+VVC_STSA_NUT   = 1,
+VVC_RADL_NUT   = 2,
+VVC_RASL_NUT   = 3,
+VVC_RSV_VCL_4  = 4,
+VVC_RSV_VCL_5  = 5,
+VVC_RSV_VCL_6  = 6,
+VVC_IDR_W_RADL = 7,
+VVC_IDR_N_LP   = 8,
+VVC_CRA_NUT= 9,
+VVC_GDR_NUT= 10,
+VVC_RSV_IRAP_11= 11,
+VVC_OPI_NUT= 12,
+VVC_DCI_NUT= 13,
+VVC_VPS_NUT= 14,
+VVC_SPS_NUT= 15,
+VVC_PPS_NUT= 16,
+VVC_PREFIX_APS_NUT = 17,
+VVC_SUFFIX_APS_NUT = 18,
+VVC_PH_NUT = 19,
+VVC_AUD_NUT= 20,
+VVC_EOS_NUT= 21,
+VVC_EOB_NUT= 22,
+VVC_PREFIX_SEI_NUT = 23,
+VVC_SUFFIX_SEI_NUT = 24,
+VVC_FD_NUT = 25,
+VVC_RSV_NVCL_26= 26,
+VVC_RSV_NVCL_27= 27,
+VVC_UNSPEC_28  = 28,
+VVC_UNSPEC_29  = 29,
+VVC_UNSPEC_30  = 30,
+VVC_UNSPEC_31  = 31,
+};
+
+enum VVCSliceType {
+VVC_SLICE_TYPE_B = 0,
+VVC_SLICE_TYPE_P = 1,
+VVC_SLICE_TYPE_I = 2,
+};
+
+enum {
+//6.2 we can have 3 sample arrays
+VVC_MAX_SAMPLE_ARRAYS = 3,
+
+//7.4.3.3 vps_max_layers_minus1 is u(6)
+VVC_MAX_LAYERS = 64,
+
+//7.4.3.3 The value of vps_max_sublayers_minus1 shall be in the range of 0 
to 6, inclusive
+VVC_MAX_SUBLAYERS = 7,
+
+//7.4.3.3 vps_num_ptls_minus1 is u(8)
+VVC_MAX_PTLS = 256,
+
+//7.4.3.3 vps_num_output_layer_sets_minus2 is u(8)
+VVC_MAX_TOTAL_NUM_OLSS = 257,
+
+// 7.3.2.3: vps_video_parameter_set_id is u(4).
+VVC_MAX_VPS_COUNT = 16,
+// 7.3.2.4: sps_seq_parameter_set_id is u(4)
+VVC_MAX_SPS_COUNT = 16,
+// 7.3.2.5: pps_pic_parameter_set_id is u(6)
+VVC_MAX_PPS_COUNT = 64,
+
+// 7.4.4.1: ptl_num_sub_profiles is u(8)
+VVC_MAX_SUB_PROFILES = 256,
+
+// A.4.2: according to (1577), MaxDpbSize is bounded above by 2 * 
maxDpbPicBuf(8)
+VVC_MAX_DPB_SIZE = 16,
+
+//7.4.3.4 sps_num_ref_pic_lists in range [0, 64]
+VVC_MAX_REF_PIC_LISTS = 64,
+
+//7.4.11 num_ref_entries in range [0, MaxDpbSize + 13]
+VVC_MAX_REF_ENTRIES = VVC_MAX_DPB_SIZE + 13,
+
+//7.4.3.3 sps_num_points_in_qp_table_minus1[i] in range [0, 36 − 
sps_qp_table_start_minus26[i]],
+//sps_qp_table_start_minus26[i] in range [sps_qp_table_start_minus26[i] 
−26 − QpBdOffset, 36]
+//for 10 bitsQpBdOffset is 12, so sps_num_points_in_qp_table_minus1[i] in 
range [0, 74]
+VVC_MAX_POINTS_IN_QP_TABLE = 75,
+
+// 7.4.6.1: hrd_cpb_cnt_minus1 is in [0, 31].
+VVC_MAX_CPB_CNT = 32,
+
+// A.4.1: the highest level allows a MaxLumaPs of 35 651 584.
+VVC_MAX_LUMA_PS = 35651584,
+
+// A.4.1: pic_width_in_luma_samples and pic_height_in_luma_samples are
+// constrained to be not greater than sqrt(MaxLumaPs * 8).  Hence height/
+// width are bounded above by sqrt(8 * 35651584) = 16888.2 samples.
+VVC_MAX_WIDTH  = 16888,
+VVC_MAX_HEIGHT = 16888,
+
+// A.4.1: table A.1 allows at most 440 tiles per au for any level.
+VVC_MAX_TILES_PER_AU = 440,
+// A.4.1: table A.1 did not define max tile rows.
+// in worest a case, we can have 1x440 tiles picture.
+VVC_MAX_TILE_ROWS= VVC_MAX_TILES_PER_AU,
+// A.4.1: table A.1 allows at most 20 tile columns for any level.
+VVC_MAX_TILE_COLUMNS = 20,
+
+// A.4.1 table A.1 allows at most 600 slice for any level.
+VVC_MAX_SLICES = 600,
+
+// 7.4.8: in the worst case (!pps_no_pic_partition_flag and
+// sps_entropy_coding_sync_enabled_flag are both true), entry points 

[FFmpeg-devel] [PATCH v1 00/11] Add support for H266/VVC

2022-10-19 Thread thomas . ff
From: Thomas Siedel 

This patch set adds H266/VVC support.
This includes parsing, muxing, demuxing, decoding and encoding.
Decoding is done using the external library VVdeC
(https://github.com/fraunhoferhhi/vvdec.git) and can be enabled with
--enable-libvvdec.
Encoding is done using the external library VVenC
(https://github.com/fraunhoferhhi/vvenc.git) and can be enabled with
--enable-libvvenc.

Thomas Siedel (11):
  avcodec: add enum types for H266/VVC
  avcodec: add cbs for H266/VVC
  avcodec: enable cbs for H266/VVC
  avcodec: add bitstream parser for H266/VVC
  avcodec: add MP4 to annexb support for H266/VVC
  avformat: add demuxer and probe support for H266/VVC
  avformat: add muxer support for H266/VVC
  avcodec: add external decoder libvvdec for H266/VVC
  avcodec: add external encoder libvvenc for H266/VVC
  avformat: add ts stream types for H266/VVC
  avcodec: increase minor version for H266/VVC

 configure |   16 +-
 libavcodec/Makefile   |6 +
 libavcodec/allcodecs.c|2 +
 libavcodec/bitstream_filters.c|2 +
 libavcodec/cbs.c  |6 +
 libavcodec/cbs_h2645.c|  384 +++-
 libavcodec/cbs_h266.h |  791 +++
 libavcodec/cbs_h266_syntax_template.c | 3010 +
 libavcodec/cbs_internal.h |3 +-
 libavcodec/cbs_sei.c  |   29 +
 libavcodec/h2645_parse.c  |   71 +-
 libavcodec/h266_metadata_bsf.c|  145 ++
 libavcodec/libvvdec.c |  511 +
 libavcodec/libvvenc.c |  432 
 libavcodec/parsers.c  |1 +
 libavcodec/version.h  |2 +-
 libavcodec/vvc.h  |  142 ++
 libavcodec/vvc_mp4toannexb_bsf.c  |  318 +++
 libavcodec/vvc_paramset.c |  972 
 libavcodec/vvc_paramset.h |  429 
 libavcodec/vvc_parse_extradata.c  |  241 ++
 libavcodec/vvc_parse_extradata.h  |   36 +
 libavcodec/vvc_parser.c   |  588 +
 libavformat/Makefile  |8 +-
 libavformat/allformats.c  |2 +
 libavformat/demux.c   |7 +-
 libavformat/isom.c|1 +
 libavformat/isom_tags.c   |3 +
 libavformat/mov.c |6 +
 libavformat/movenc.c  |   41 +-
 libavformat/mpeg.c|3 +
 libavformat/mpeg.h|1 +
 libavformat/mpegts.c  |2 +
 libavformat/mpegts.h  |1 +
 libavformat/mpegtsenc.c   |   65 +
 libavformat/rawenc.c  |   23 +
 libavformat/vvc.c |  918 
 libavformat/vvc.h |   99 +
 libavformat/vvcdec.c  |   61 +
 39 files changed, 9366 insertions(+), 12 deletions(-)
 create mode 100644 libavcodec/cbs_h266.h
 create mode 100644 libavcodec/cbs_h266_syntax_template.c
 create mode 100644 libavcodec/h266_metadata_bsf.c
 create mode 100644 libavcodec/libvvdec.c
 create mode 100644 libavcodec/libvvenc.c
 create mode 100644 libavcodec/vvc.h
 create mode 100644 libavcodec/vvc_mp4toannexb_bsf.c
 create mode 100644 libavcodec/vvc_paramset.c
 create mode 100644 libavcodec/vvc_paramset.h
 create mode 100644 libavcodec/vvc_parse_extradata.c
 create mode 100644 libavcodec/vvc_parse_extradata.h
 create mode 100644 libavcodec/vvc_parser.c
 create mode 100644 libavformat/vvc.c
 create mode 100644 libavformat/vvc.h
 create mode 100644 libavformat/vvcdec.c

-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".