[FFmpeg-devel] [PATCH] lavc/libopenh264: Check for noopenh264
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, +.priv_data_size = sizeof(SVCContext), +.init_static_data = svc_encode_init_static_data, +.init = svc_encode_init, FF_CODEC_ENCODE_CB(svc_encode_frame), -.close = svc_encode_close, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP | - FF_CODEC_CAP_AUTO_THREADS, -.p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, -AV_PIX_FMT_YUVJ420P, -AV_PIX_FMT_NONE }, -.defaults = svc_enc_defaults, -.p.priv_class = , -.p.wrapper_name = "libopenh264", +.close= svc_encode_close, +.caps_internal= FF_CODEC_CAP_INIT_CLEANUP | +FF_CODEC_CAP_AUTO_THREADS, +.p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_NONE }, +.defaults = svc_enc_defaults, +.p.priv_class = , +.p.wrapper_name = "libopenh264", }; diff --git a/libavcodec/tests/avcodec.c b/libavcodec/tests/avcodec.c index 08ca507bf0..0e2ecccbf9 100644 --- a/libavcodec/tests/avcodec.c +++ b/libavcodec/tests/avcodec.c @@ -112,6 +112,8 @@ int main(void){ case FF_CODEC_CB_TYPE_RECEIVE_PACKET: is_encoder = 1; break; +case FF_CODEC_CB_TYPE_NONE: +continue; default: ERR("Codec %s has unknown cb_type\n"); continue; --- base-commit: 81c2557691b12ceb79b3ba92aa496f2301ab4d18 change-id: 20240210-noopenh264-650461efbc33 Best regards, -- Akihiko Odaki ___ 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] avcodec/vc1dec: Fix vc1_hwaccel_pixfmt_list_420
Akihiko Odaki: > vc1_hwaccel_pixfmt_list_420 is referenced even if > !(CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER) so move it out > of the #if block. > > Signed-off-by: Akihiko Odaki > --- > libavcodec/vc1dec.c | 42 +- > 1 file changed, 21 insertions(+), 21 deletions(-) > > diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c > index e71b92eef8..3ca478e82a 100644 > --- a/libavcodec/vc1dec.c > +++ b/libavcodec/vc1dec.c > @@ -51,27 +51,6 @@ > #include "libavutil/thread.h" > > > -#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER > - > -typedef struct SpriteData { > -/** > - * Transform coefficients for both sprites in 16.16 fixed point format, > - * in the order they appear in the bitstream: > - * x scale > - * rotation 1 (unused) > - * x offset > - * rotation 2 (unused) > - * y scale > - * y offset > - * alpha > - */ > -int coefs[2][7]; > - > -int effect_type, effect_flag; > -int effect_pcount1, effect_pcount2; ///< amount of effect parameters > stored in effect_params > -int effect_params1[15], effect_params2[10]; ///< effect parameters in > 16.16 fixed point format > -} SpriteData; > - > static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = { > #if CONFIG_VC1_DXVA2_HWACCEL > AV_PIX_FMT_DXVA2_VLD, > @@ -96,6 +75,27 @@ static const enum AVPixelFormat > vc1_hwaccel_pixfmt_list_420[] = { > AV_PIX_FMT_NONE > }; > > +#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER > + > +typedef struct SpriteData { > +/** > + * Transform coefficients for both sprites in 16.16 fixed point format, > + * in the order they appear in the bitstream: > + * x scale > + * rotation 1 (unused) > + * x offset > + * rotation 2 (unused) > + * y scale > + * y offset > + * alpha > + */ > +int coefs[2][7]; > + > +int effect_type, effect_flag; > +int effect_pcount1, effect_pcount2; ///< amount of effect parameters > stored in effect_params > +int effect_params1[15], effect_params2[10]; ///< effect parameters in > 16.16 fixed point format > +} SpriteData; > + > static inline int get_fp_val(GetBitContext* gb) > { > return (get_bits_long(gb, 30) - (1 << 29)) << 1; > > --- > base-commit: 81c2557691b12ceb79b3ba92aa496f2301ab4d18 > change-id: 20240210-vc1dec-dc6d7b31f795 > > Best regards, LGTM. Sorry for that, I didn't realize that this block was #if'ed. Will apply. - 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".
[FFmpeg-devel] [PATCH] avcodec/vc1dec: Fix vc1_hwaccel_pixfmt_list_420
vc1_hwaccel_pixfmt_list_420 is referenced even if !(CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER) so move it out of the #if block. Signed-off-by: Akihiko Odaki --- libavcodec/vc1dec.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index e71b92eef8..3ca478e82a 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -51,27 +51,6 @@ #include "libavutil/thread.h" -#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER - -typedef struct SpriteData { -/** - * Transform coefficients for both sprites in 16.16 fixed point format, - * in the order they appear in the bitstream: - * x scale - * rotation 1 (unused) - * x offset - * rotation 2 (unused) - * y scale - * y offset - * alpha - */ -int coefs[2][7]; - -int effect_type, effect_flag; -int effect_pcount1, effect_pcount2; ///< amount of effect parameters stored in effect_params -int effect_params1[15], effect_params2[10]; ///< effect parameters in 16.16 fixed point format -} SpriteData; - static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = { #if CONFIG_VC1_DXVA2_HWACCEL AV_PIX_FMT_DXVA2_VLD, @@ -96,6 +75,27 @@ static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = { AV_PIX_FMT_NONE }; +#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER + +typedef struct SpriteData { +/** + * Transform coefficients for both sprites in 16.16 fixed point format, + * in the order they appear in the bitstream: + * x scale + * rotation 1 (unused) + * x offset + * rotation 2 (unused) + * y scale + * y offset + * alpha + */ +int coefs[2][7]; + +int effect_type, effect_flag; +int effect_pcount1, effect_pcount2; ///< amount of effect parameters stored in effect_params +int effect_params1[15], effect_params2[10]; ///< effect parameters in 16.16 fixed point format +} SpriteData; + static inline int get_fp_val(GetBitContext* gb) { return (get_bits_long(gb, 30) - (1 << 29)) << 1; --- base-commit: 81c2557691b12ceb79b3ba92aa496f2301ab4d18 change-id: 20240210-vc1dec-dc6d7b31f795 Best regards, -- Akihiko Odaki ___ 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] FFmpeg 7.0 blocking issues
On Sun, Feb 11, 2024 at 9:35 AM Michael Niedermayer wrote: > On Sat, Feb 10, 2024 at 06:03:57PM -0300, James Almer wrote: > > On 1/23/2024 4:22 PM, Michael Niedermayer wrote: > > > Hi all > > > > > > As it was a little difficult for me to not loose track of what is > > > blocking a release. I suggest that for all release blocking issues > > > open a ticket and set Blocking to 7.0 > > > that way this: > > > https://trac.ffmpeg.org/query?blocking=~7.0 > > > > > > or for the ones not closed: > > > > https://trac.ffmpeg.org/query?status=new=open=reopened=~7.0 > > > > > > will list all blocking issues > > > > > > Ive added one, for testing that, i intend to add more if i see > something > > > > > > What is blocking? (IMHO) > > > * regressions (unless its non possible to fix before release) > > > * crashes > > > * security issues > > > * data loss > > > * privacy issues > > > * anything the commuity agrees should be in the release > > > > > > thx > > > > There are currently issues with the hevc decoder after some of the > commits > > that shared code with the vvc decoder were pushed. You can see it by > running > > the hevc conformance suite in FATE under GCC ubsan. > > > > Nuo Mi said he's looking at them, but if it takes him too much time we > can > > revert the faulty commits before the release, in either master or even > the > > actual release branch. > > Please create a ticket for this and add blocking: 7.0 > So it cannot be forgotten > Will be fixed by https://patchwork.ffmpeg.org/project/ffmpeg/patch/tyspr06mb6433517914b4c4432d6799e5aa...@tyspr06mb6433.apcprd06.prod.outlook.com/ > > thx > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > "Nothing to hide" only works if the folks in power share the values of > you and everyone you know entirely and always will -- Tom Scott > > ___ > 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 v4 1/8] avcodec/vvc/vvc_inter_template: move put/put_luma/put_chroma template to h2656_inter_template.c
On Fri, Feb 2, 2024 at 9:40 PM Nuo Mi wrote: > > > On Thu, Feb 1, 2024 at 9:14 PM James Almer wrote: > >> On 2/1/2024 9:15 AM, Nuo Mi wrote: >> > On Wed, Jan 24, 2024 at 2:17 AM wrote: >> > >> >> From: Wu Jianhua >> >> >> >> Signed-off-by: Wu Jianhua >> >> --- >> >> libavcodec/h26x/h2656_inter_template.c | 577 >> + >> >> libavcodec/vvc/vvc_inter_template.c| 559 +--- >> >> 2 files changed, 578 insertions(+), 558 deletions(-) >> >> create mode 100644 libavcodec/h26x/h2656_inter_template.c >> >> >> > >> > Applied. Thank you, Jianhua. >> > >> > Thank you, Michael and Andriy, for your great help >> >> The latest push broke hevc tests under gcc ubsan >> >> http://fate.ffmpeg.org/report.cgi?slot=x86_64-archlinux-gcc-ubsan=20240201125247 > > Thank you James, We will fix it. > Hi James, Apologies for the delay Fixed by https://patchwork.ffmpeg.org/project/ffmpeg/patch/tyspr06mb6433517914b4c4432d6799e5aa...@tyspr06mb6433.apcprd06.prod.outlook.com/ >> >> ___ >> 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] [PATCH] avcodec/hevcdec: fix out of bounds index -1 for inter prediction
It's a false positive. We use -1 to index an array, but it's not actually used. This patch will make the "GCC UndefinedBehaviorSanitizer" happy. Found by: checkasm-hevc_pel in https://fate.ffmpeg.org/report.cgi?time=20240211011905=x86_64-archlinux-gcc-ubsan Reported-by: James Almer --- libavcodec/hevcdsp_template.c | 6 +++--- libavcodec/x86/hevcdsp_init.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c index 9b48bdf08e..a4b8901e5d 100644 --- a/libavcodec/hevcdsp_template.c +++ b/libavcodec/hevcdsp_template.c @@ -301,9 +301,9 @@ IDCT_DC(32) // #define ff_hevc_pel_filters ff_hevc_qpel_filters -#define DECL_HV_FILTER(f) \ -const uint8_t *hf = ff_hevc_ ## f ## _filters[mx - 1]; \ -const uint8_t *vf = ff_hevc_ ## f ## _filters[my - 1]; +#define DECL_HV_FILTER(f) \ +const uint8_t *hf = mx ? ff_hevc_ ## f ## _filters[mx - 1] : NULL; \ +const uint8_t *vf = my ? ff_hevc_ ## f ## _filters[my - 1] : NULL; #define FW_PUT(p, f, t) \ static void FUNC(put_hevc_## f)(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, int height,\ diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c index 31e81eb11f..e0f65177c4 100644 --- a/libavcodec/x86/hevcdsp_init.c +++ b/libavcodec/x86/hevcdsp_init.c @@ -87,9 +87,9 @@ IDCT_FUNCS(avx) #define ff_hevc_pel_filters ff_hevc_qpel_filters -#define DECL_HV_FILTER(f) \ -const uint8_t *hf = ff_hevc_ ## f ## _filters[mx - 1]; \ -const uint8_t *vf = ff_hevc_ ## f ## _filters[my - 1]; +#define DECL_HV_FILTER(f) \ +const uint8_t *hf = mx ? ff_hevc_ ## f ## _filters[mx - 1] : NULL; \ +const uint8_t *vf = my ? ff_hevc_ ## f ## _filters[my - 1] : NULL; \ #define FW_PUT(p, a, b, depth, opt) \ void ff_hevc_put_hevc_ ## a ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, \ -- 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] [RFC PATCH] avformat/rtpdec: Audio level RTP extension RFC6464
From: Jonathan Baudanza libwebrtc will add audio level (in decibels) and VAD status to each RTP packet. This patch will add both values to the packet sidedata. I've been using this patch in production for about a year on live audio RTP streams to detect when users are speaking without needing to decode the audio data. --- libavcodec/avpacket.c | 1 + libavcodec/defs.h | 15 libavcodec/packet.h | 5 +++ libavformat/rtpdec.c | 87 +++ libavformat/rtpdec.h | 5 +++ libavformat/rtsp.c| 16 libavformat/rtsp.h| 2 + 7 files changed, 131 insertions(+) diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index e118bbaad1..73e0341bf7 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -305,6 +305,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type) case AV_PKT_DATA_IAMF_MIX_GAIN_PARAM:return "IAMF Mix Gain Parameter Data"; case AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM: return "IAMF Demixing Info Parameter Data"; case AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM: return "IAMF Recon Gain Info Parameter Data"; +case AV_PKT_DATA_SSRC_AUDIO_LEVEL: return "RTP SSRC Audio Level"; } return NULL; } diff --git a/libavcodec/defs.h b/libavcodec/defs.h index 00d840ec19..87e8814760 100644 --- a/libavcodec/defs.h +++ b/libavcodec/defs.h @@ -323,6 +323,21 @@ typedef struct AVProducerReferenceTime { int flags; } AVProducerReferenceTime; +/** + * Audio level structure from the ssrc-audio-level RTP header extension. + */ +typedef struct AVAudioLevel { +/** + * Audio level for this packet, measured in dBov: -127 - 0 + */ +int8_t level; + +/** + * Set to 1 if the encoder believes this packet contains voice. + */ +int voice; +} AVAudioLevel; + /** * Encode extradata length to a buffer. Used by xiph codecs. * diff --git a/libavcodec/packet.h b/libavcodec/packet.h index 8558ae849e..f7f1deb6e0 100644 --- a/libavcodec/packet.h +++ b/libavcodec/packet.h @@ -330,6 +330,11 @@ enum AVPacketSideDataType { */ AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT, +/** + * Audio Level and VAD data from the RTP header extension as defined by RFC 6464. + */ +AV_PKT_DATA_SSRC_AUDIO_LEVEL, + /** * The number of side data types. * This is not part of the public API/ABI in the sense that it may diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index fa7544cc07..479ea2e245 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -694,6 +694,79 @@ static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestam s->base_timestamp; } + +static const uint8_t* find_header_ext_data(int id, const uint8_t *buf, uint8_t *len) { +int buflen = (AV_RB16(buf + 2)) * 4; + +const uint8_t *p = buf + 4; +int idx = 0; +int this_id; +int this_len; + +// This is a one-byte extention format, as defined by RFC rfc5285 +if (buf[0] == 0xbe && buf[1] == 0xde) { +while (idx + 1 < buflen) { +if (p[idx] == 0) { +idx++; // skip padding +} else { +this_id = p[idx] >> 4; +this_len = (p[idx] & 0xf) + 1; + +// spec says 15 is reserved +if (this_id == 15) { +break; // reject +} + +if (this_id == id) { +if (this_len > buflen - idx - 1) { +break; // reject +} + +if (len != NULL) +*len = this_len; + +return p + idx + 1; +} + +idx += 1 + this_len; +} +} +} else if (buf[0] == 0x10 && (buf[1] & 0xff) == 0) { +// This is a two-byte extention format +while (idx + 1 < buflen) { +if (p[idx] == 0) { +idx++; // Skip padding +} else { +this_id = p[idx]; +this_len = p[idx + 1]; + +// spec says 15 is reserved +if (this_id == 15) { +break; // reject +} + +if (this_id == id) { +if (this_len > buflen - idx - 2) { +break; // reject +} + +if (len != NULL) +*len = this_len; +return p + idx + 2; +} + +idx += 2 + this_len; +} +} +} + +if (len != NULL) +*len = 0; + +return NULL; +} + + static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt, const uint8_t *buf, int len) { @@ -703,6 +776,7 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt, AVStream *st; uint32_t timestamp; int rv = 0; +
Re: [FFmpeg-devel] FFmpeg 7.0 blocking issues
On Sat, Feb 10, 2024 at 06:03:57PM -0300, James Almer wrote: > On 1/23/2024 4:22 PM, Michael Niedermayer wrote: > > Hi all > > > > As it was a little difficult for me to not loose track of what is > > blocking a release. I suggest that for all release blocking issues > > open a ticket and set Blocking to 7.0 > > that way this: > > https://trac.ffmpeg.org/query?blocking=~7.0 > > > > or for the ones not closed: > > https://trac.ffmpeg.org/query?status=new=open=reopened=~7.0 > > > > will list all blocking issues > > > > Ive added one, for testing that, i intend to add more if i see something > > > > What is blocking? (IMHO) > > * regressions (unless its non possible to fix before release) > > * crashes > > * security issues > > * data loss > > * privacy issues > > * anything the commuity agrees should be in the release > > > > thx > > There are currently issues with the hevc decoder after some of the commits > that shared code with the vvc decoder were pushed. You can see it by running > the hevc conformance suite in FATE under GCC ubsan. > > Nuo Mi said he's looking at them, but if it takes him too much time we can > revert the faulty commits before the release, in either master or even the > actual release branch. Please create a ticket for this and add blocking: 7.0 So it cannot be forgotten thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB "Nothing to hide" only works if the folks in power share the values of you and everyone you know entirely and always will -- Tom Scott 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".
Re: [FFmpeg-devel] [REFUND-REQUEST] FOSDEM'24 Travel
On Wed, Feb 07, 2024 at 12:34:02AM +0100, Stefano Sabatini wrote: > On date Tuesday 2024-02-06 14:35:31 +0100, Niklas Haas wrote: > > Hi, > > > > Due to unforeseen circumstances (DB cancelling my train), I had to take > > an Uber to the train station to just barely get there in time for the > > alternative connection. > > > > 248,40 EUR: ICE Ulm <-> Bruxelle-Midi > > 18.16 EUR: Uber FOSDEM -> Bruxelle-Midi > > > > 266.56 EUR: total > > Approved on my side, pending Michael's approval. LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The bravest are surely those who have the clearest vision of what is before them, glory and danger alike, and yet notwithstanding go out to meet it. -- Thucydides 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".
Re: [FFmpeg-devel] [REFUND-REQUEST] FOSDEM '24 Expenses
On Wed, Feb 07, 2024 at 12:36:54AM +0100, Stefano Sabatini wrote: > On date Tuesday 2024-02-06 17:36:40 +, Frank Plowman wrote: > > Hello, > > > > I am requesting reimbursement for the following expenses made attending > > FOSDEM 2024, where I delivered a talk about the FFmpeg VVC decoder and > > met with FFmpeg developers. > > > > Expense | Amount (GBP) > > --+- > > Return flight MAN <-> CRL |45.98 > > Coach LDS -> MAN | 7.80 > > Coach MAN -> LDS | 9.00 > > 2 nights Airbnb | 110.07 > > Train CRL -> BRU |14.90 > > Coach BRU -> CRL |16.91 > > Taxi LDS -> Home |10.92 > > --+- > > Total | 215.58 > > > > I took the taxi from the coach station to my house as it was in the > > early hours and public transport was not running. > > Approved on my side, pending Michael's approval. > > To get the refund, follow instructions here to generate a refund request: > https://www.spi-inc.org/treasurer/reimbursement-form/ > > Then email it to: > treasu...@rt.spi-inc.org > > putting me and Michael in CC:, and adding the thread link from: > http://ffmpeg.org/pipermail/ffmpeg-devel/ LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB You can kill me, but you cannot change the truth. 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] [PATCH 4/4] fate/mov: add tests for HEIF samples with derived images
Map the group to remux all streams in it. Signed-off-by: James Almer --- tests/fate/mov.mak| 8 + .../ref/fate/mov-heic-demux-still-image-grid | 32 +++ .../ref/fate/mov-heic-demux-still-image-iovl | 18 +++ 3 files changed, 58 insertions(+) create mode 100644 tests/ref/fate/mov-heic-demux-still-image-grid create mode 100644 tests/ref/fate/mov-heic-demux-still-image-iovl diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index 1be7a0d15a..a8206a1b58 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -163,6 +163,14 @@ FATE_MOV_FFMPEG-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \ += fate-mov-heic-demux-still-image-multiple-items fate-mov-heic-demux-still-image-multiple-items: CMD = framemd5 -i $(TARGET_SAMPLES)/heif-conformance/C003.heic -c:v copy -map 0 +FATE_MOV_FFMPEG-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \ + += fate-mov-heic-demux-still-image-grid +fate-mov-heic-demux-still-image-grid: CMD = framemd5 -i $(TARGET_SAMPLES)/heif-conformance/C007.heic -c:v copy -map 0:g:0 + +FATE_MOV_FFMPEG-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \ + += fate-mov-heic-demux-still-image-iovl +fate-mov-heic-demux-still-image-iovl: CMD = framemd5 -i $(TARGET_SAMPLES)/heif-conformance/C015.heic -c:v copy -map 0:g:0 + # Resulting remux should have: # 1. first audio stream with AV_DISPOSITION_HEARING_IMPAIRED # 2. second audio stream with AV_DISPOSITION_VISUAL_IMPAIRED | DESCRIPTIONS diff --git a/tests/ref/fate/mov-heic-demux-still-image-grid b/tests/ref/fate/mov-heic-demux-still-image-grid new file mode 100644 index 00..6fde8fff28 --- /dev/null +++ b/tests/ref/fate/mov-heic-demux-still-image-grid @@ -0,0 +1,32 @@ +#format: frame checksums +#version: 2 +#hash: MD5 +#extradata 0, 100, 5444bf01e03182c73ae957179d560f4d +#extradata 1, 100, 5444bf01e03182c73ae957179d560f4d +#extradata 2, 100, 5444bf01e03182c73ae957179d560f4d +#extradata 3, 100, 5444bf01e03182c73ae957179d560f4d +#tb 0: 1/1 +#media_type 0: video +#codec_id 0: hevc +#dimensions 0: 1280x720 +#sar 0: 0/1 +#tb 1: 1/1 +#media_type 1: video +#codec_id 1: hevc +#dimensions 1: 1280x720 +#sar 1: 0/1 +#tb 2: 1/1 +#media_type 2: video +#codec_id 2: hevc +#dimensions 2: 1280x720 +#sar 2: 0/1 +#tb 3: 1/1 +#media_type 3: video +#codec_id 3: hevc +#dimensions 3: 1280x720 +#sar 3: 0/1 +#stream#, dts,pts, duration, size, hash +0, 0, 0,1, 111554, 03ceabfab39afd2e2e796b9362111f32 +1, 0, 0,1, 111481, e5db978adbe4de7ee50fe73abc39fcfa +2, 0, 0,1, 111451, 08700213113cadbb6628ecb8253c1c2a +3, 0, 0,1, 111353, 5de942e14c848e5e22fad5d88fb13776 diff --git a/tests/ref/fate/mov-heic-demux-still-image-iovl b/tests/ref/fate/mov-heic-demux-still-image-iovl new file mode 100644 index 00..753cef267a --- /dev/null +++ b/tests/ref/fate/mov-heic-demux-still-image-iovl @@ -0,0 +1,18 @@ +#format: frame checksums +#version: 2 +#hash: MD5 +#extradata 0, 100, 5444bf01e03182c73ae957179d560f4d +#extradata 1, 100, 5444bf01e03182c73ae957179d560f4d +#tb 0: 1/1 +#media_type 0: video +#codec_id 0: hevc +#dimensions 0: 1280x720 +#sar 0: 0/1 +#tb 1: 1/1 +#media_type 1: video +#codec_id 1: hevc +#dimensions 1: 1280x720 +#sar 1: 0/1 +#stream#, dts,pts, duration, size, hash +0, 0, 0,1, 111554, 03ceabfab39afd2e2e796b9362111f32 +1, 0, 0,1, 112393, daa001d351c088a5bc328459e2501c95 -- 2.43.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] [PATCH v2 3/3] lavc/dxv: remove ctx fields that can be derived from texdsp ctxs
Feb 10, 2024, 23:59 by connorbwor...@gmail.com: > Signed-off-by: Connor Worley > --- > libavcodec/dxv.c | 53 > 1 file changed, 9 insertions(+), 44 deletions(-) > > diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c > index cd78de3e0d..82c493f1de 100644 > --- a/libavcodec/dxv.c > +++ b/libavcodec/dxv.c > @@ -39,20 +39,12 @@ typedef struct DXVContext { > lgtm, patchset pushed Thanks ___ 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] avformat: add a disposition field to AVStreamGroup
The existing (and upcoming) available group types are meant to combine several streams for presentation, with the result being treated as if it was a stream itself. For example, a file could export two stream groups of the same type with one of them as the "default". Signed-off-by: James Almer --- libavformat/avformat.h | 8 + libavformat/dump.c | 77 ++ libavformat/options.c | 45 3 files changed, 73 insertions(+), 57 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 5d0fe82250..931c274879 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1093,6 +1093,14 @@ typedef struct AVStreamGroup { * Freed by libavformat in avformat_free_context(). */ AVStream **streams; + +/** + * Stream group disposition - a combination of AV_DISPOSITION_* flags. + * - demuxing: set by libavformat when creating the group or in + * avformat_find_stream_info(). + * - muxing: may be set by the caller before avformat_write_header(). + */ +int disposition; } AVStreamGroup; struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); diff --git a/libavformat/dump.c b/libavformat/dump.c index 9d37179bb7..c72d7840c1 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -538,6 +538,46 @@ static void dump_sidedata(void *ctx, const AVStream *st, const char *indent, } } +static void dump_disposition(int disposition, int log_level) +{ +if (disposition & AV_DISPOSITION_DEFAULT) +av_log(NULL, log_level, " (default)"); +if (disposition & AV_DISPOSITION_DUB) +av_log(NULL, log_level, " (dub)"); +if (disposition & AV_DISPOSITION_ORIGINAL) +av_log(NULL, log_level, " (original)"); +if (disposition & AV_DISPOSITION_COMMENT) +av_log(NULL, log_level, " (comment)"); +if (disposition & AV_DISPOSITION_LYRICS) +av_log(NULL, log_level, " (lyrics)"); +if (disposition & AV_DISPOSITION_KARAOKE) +av_log(NULL, log_level, " (karaoke)"); +if (disposition & AV_DISPOSITION_FORCED) +av_log(NULL, log_level, " (forced)"); +if (disposition & AV_DISPOSITION_HEARING_IMPAIRED) +av_log(NULL, log_level, " (hearing impaired)"); +if (disposition & AV_DISPOSITION_VISUAL_IMPAIRED) +av_log(NULL, log_level, " (visual impaired)"); +if (disposition & AV_DISPOSITION_CLEAN_EFFECTS) +av_log(NULL, log_level, " (clean effects)"); +if (disposition & AV_DISPOSITION_ATTACHED_PIC) +av_log(NULL, log_level, " (attached pic)"); +if (disposition & AV_DISPOSITION_TIMED_THUMBNAILS) +av_log(NULL, log_level, " (timed thumbnails)"); +if (disposition & AV_DISPOSITION_CAPTIONS) +av_log(NULL, log_level, " (captions)"); +if (disposition & AV_DISPOSITION_DESCRIPTIONS) +av_log(NULL, log_level, " (descriptions)"); +if (disposition & AV_DISPOSITION_METADATA) +av_log(NULL, log_level, " (metadata)"); +if (disposition & AV_DISPOSITION_DEPENDENT) +av_log(NULL, log_level, " (dependent)"); +if (disposition & AV_DISPOSITION_STILL_IMAGE) +av_log(NULL, log_level, " (still image)"); +if (disposition & AV_DISPOSITION_NON_DIEGETIC) +av_log(NULL, log_level, " (non-diegetic)"); +} + /* "user interface" functions */ static void dump_stream_format(const AVFormatContext *ic, int i, int group_index, int index, int is_output, @@ -620,42 +660,7 @@ static void dump_stream_format(const AVFormatContext *ic, int i, print_fps(1 / av_q2d(st->time_base), "tbn", log_level); } -if (st->disposition & AV_DISPOSITION_DEFAULT) -av_log(NULL, log_level, " (default)"); -if (st->disposition & AV_DISPOSITION_DUB) -av_log(NULL, log_level, " (dub)"); -if (st->disposition & AV_DISPOSITION_ORIGINAL) -av_log(NULL, log_level, " (original)"); -if (st->disposition & AV_DISPOSITION_COMMENT) -av_log(NULL, log_level, " (comment)"); -if (st->disposition & AV_DISPOSITION_LYRICS) -av_log(NULL, log_level, " (lyrics)"); -if (st->disposition & AV_DISPOSITION_KARAOKE) -av_log(NULL, log_level, " (karaoke)"); -if (st->disposition & AV_DISPOSITION_FORCED) -av_log(NULL, log_level, " (forced)"); -if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED) -av_log(NULL, log_level, " (hearing impaired)"); -if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED) -av_log(NULL, log_level, " (visual impaired)"); -if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS) -av_log(NULL, log_level, " (clean effects)"); -if (st->disposition & AV_DISPOSITION_ATTACHED_PIC) -av_log(NULL, log_level, " (attached pic)"); -if (st->disposition & AV_DISPOSITION_TIMED_THUMBNAILS) -av_log(NULL, log_level, " (timed thumbnails)"); -if (st->disposition & AV_DISPOSITION_CAPTIONS) -
[FFmpeg-devel] [PATCH 35/35] avfilter/avfilter: Reorder structure fields
Move related fields closer together and try to plug holes. Signed-off-by: Andreas Rheinhardt --- libavfilter/avfilter.h | 41 - 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 35840cfd54..f376d25efc 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -441,6 +441,13 @@ struct AVFilterContext { */ int thread_type; +/** + * Max number of threads allowed in this filter instance. + * If <= 0, its value is ignored. + * Overrides global number of threads set per filter graph. + */ +int nb_threads; + struct AVFilterCommand *command_queue; char *enable_str; ///< enable expression string @@ -461,13 +468,6 @@ struct AVFilterContext { */ AVBufferRef *hw_device_ctx; -/** - * Max number of threads allowed in this filter instance. - * If <= 0, its value is ignored. - * Overrides global number of threads set per filter graph. - */ -int nb_threads; - /** * Ready status of the filter. * A non-0 value means that the filter needs activating; @@ -548,14 +548,25 @@ struct AVFilterLink { enum AVMediaType type; ///< filter media type +int format; ///< agreed upon media format + /* These parameters apply only to video */ int w; ///< agreed upon image width int h; ///< agreed upon image height AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio +/** + * For non-YUV links, these are respectively set to fallback values (as + * appropriate for that colorspace). + * + * Note: This includes grayscale formats, as these are currently treated + * as forced full range always. + */ +enum AVColorSpace colorspace; ///< agreed upon YUV color space +enum AVColorRange color_range; ///< agreed upon YUV color range + /* These parameters apply only to audio */ int sample_rate;///< samples per second - -int format; ///< agreed upon media format +AVChannelLayout ch_layout; ///< channel layout of current buffer (see libavutil/channel_layout.h) /** * Define the time base used by the PTS of the frames/samples @@ -566,18 +577,6 @@ struct AVFilterLink { */ AVRational time_base; -AVChannelLayout ch_layout; ///< channel layout of current buffer (see libavutil/channel_layout.h) - -/** - * For non-YUV links, these are respectively set to fallback values (as - * appropriate for that colorspace). - * - * Note: This includes grayscale formats, as these are currently treated - * as forced full range always. - */ -enum AVColorSpace colorspace; ///< agreed upon YUV color space -enum AVColorRange color_range; ///< agreed upon YUV color range - /* * All fields below this line are not part of the public API. They * may not be used outside of libavfilter and can be changed and -- 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".
[FFmpeg-devel] [PATCH 34/35] avcodec/avcodec: Reorder AVCodecContext and AVSubtitleRect fields
Move related fields closer together and try to plug holes. Signed-off-by: Andreas Rheinhardt --- libavcodec/avcodec.h | 585 +-- 1 file changed, 292 insertions(+), 293 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 431fc11de6..6706061ecc 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -490,29 +490,6 @@ typedef struct AVCodecContext { */ int64_t bit_rate; -/** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - */ -int bit_rate_tolerance; - -/** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - */ -int global_quality; - -/** - * - encoding: Set by user. - * - decoding: unused - */ -int compression_level; -#define FF_COMPRESSION_DEFAULT -1 - /** * AV_CODEC_FLAG_*. * - encoding: Set by user. @@ -562,6 +539,22 @@ typedef struct AVCodecContext { */ AVRational time_base; +/** + * Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed. + * - encoding: unused. + * - decoding: set by user. + */ +AVRational pkt_timebase; + +/** + * - decoding: For codecs that store a framerate value in the compressed + * bitstream, the decoder may export it here. { 0, 1} when + * unknown. + * - encoding: May be used to signal the framerate of CFR content to an + * encoder. + */ +AVRational framerate; + #if FF_API_TICKS_PER_FRAME /** * For some codecs, the time base is closer to the field rate than the frame rate. @@ -636,11 +629,13 @@ typedef struct AVCodecContext { int coded_width, coded_height; /** - * the number of pictures in a group of pictures, or 0 for intra_only + * sample aspect ratio (0 if unknown) + * That is the width of a pixel divided by the height of the pixel. + * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. * - encoding: Set by user. - * - decoding: unused + * - decoding: Set by libavcodec. */ -int gop_size; +AVRational sample_aspect_ratio; /** * Pixel format, see AV_PIX_FMT_xxx. @@ -657,6 +652,82 @@ typedef struct AVCodecContext { */ enum AVPixelFormat pix_fmt; +/** + * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. + * - encoding: unused. + * - decoding: Set by libavcodec before calling get_format() + */ +enum AVPixelFormat sw_pix_fmt; + +/** + * Chromaticity coordinates of the source primaries. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ +enum AVColorPrimaries color_primaries; + +/** + * Color Transfer Characteristic. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ +enum AVColorTransferCharacteristic color_trc; + +/** + * YUV colorspace type. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ +enum AVColorSpace colorspace; + +/** + * MPEG vs JPEG YUV range. + * - encoding: Set by user to override the default output color range value, + * If not specified, libavcodec sets the color range depending on the + * output format. + * - decoding: Set by libavcodec, can be set by the user to propagate the + * color range to components reading from the decoder context. + */ +enum AVColorRange color_range; + +/** + * This defines the location of chroma samples. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ +enum AVChromaLocation chroma_sample_location; + +/** Field order + * - encoding: set by libavcodec + * - decoding: Set by user. + */ +enum AVFieldOrder field_order; + +/** + * number of reference frames + * - encoding: Set by user. + * - decoding: Set by lavc. + */ +int refs; + +/** + * Size of the frame reordering buffer in the decoder. + * For MPEG-2 it is 1 IPB or 0 low delay IP. + * - encoding: Set by libavcodec. + * - decoding: Set by libavcodec. + */ +int has_b_frames; + +/** + * slice flags + * - encoding: unused + * - decoding: Set by user. + */ +int slice_flags; +#define SLICE_FLAG_CODED_ORDER0x0001 ///< draw_horiz_band() is called in coded order instead of display +#define SLICE_FLAG_ALLOW_FIELD0x0002 ///< allow draw_horiz_band() with field slices (MPEG-2 field pics) +#define SLICE_FLAG_ALLOW_PLANE0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1) + /** * If non NULL,
[FFmpeg-devel] [PATCH 33/35] avfilter/avfilter: Move AVFilterGraph private fields to FFFilterGraph
(These fields were in AVFilterGraph although AVFilterGraphInternal existed for years.) Signed-off-by: Andreas Rheinhardt --- libavfilter/avfilter.h | 12 libavfilter/avfilter_internal.h | 6 ++ libavfilter/avfiltergraph.c | 32 +--- 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 65034f831a..35840cfd54 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -922,18 +922,6 @@ typedef struct AVFilterGraph { avfilter_execute_func *execute; char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions - -/** - * Private fields - * - * The following fields are for internal use only. - * Their type, offset, number and semantic can change without notice. - */ - -AVFilterLink **sink_links; -int sink_links_count; - -unsigned disable_auto_convert; } AVFilterGraph; /** diff --git a/libavfilter/avfilter_internal.h b/libavfilter/avfilter_internal.h index 9ddb82bf26..72712608e7 100644 --- a/libavfilter/avfilter_internal.h +++ b/libavfilter/avfilter_internal.h @@ -41,6 +41,12 @@ typedef struct FFFilterGraph { * The public AVFilterGraph. See avfilter.h for it. */ AVFilterGraph p; + +AVFilterLink **sink_links; +int sink_links_count; + +unsigned disable_auto_convert; + void *thread; avfilter_execute_func *thread_execute; FFFrameQueueGlobal frame_queues; diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 0e2b5ee1f2..c25fc42430 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -127,7 +127,7 @@ void avfilter_graph_free(AVFilterGraph **graphp) ff_graph_thread_free(graphi); -av_freep(>sink_links); +av_freep(>sink_links); av_opt_free(graph); @@ -159,7 +159,7 @@ fail: void avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags) { -graph->disable_auto_convert = flags; +fffiltergraph(graph)->disable_auto_convert = flags; } AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph, @@ -471,7 +471,7 @@ static int query_formats(AVFilterGraph *graph, void *log_ctx) char inst_name[30]; const char *opts; -if (graph->disable_auto_convert) { +if (fffiltergraph(graph)->disable_auto_convert) { av_log(log_ctx, AV_LOG_ERROR, "The filters '%s' and '%s' do not have a common format " "and automatic conversion is disabled.\n", @@ -1311,8 +1311,8 @@ static int graph_config_pointers(AVFilterGraph *graph, void *log_ctx) } } av_assert0(n == sink_links_count); -graph->sink_links = sinks; -graph->sink_links_count = sink_links_count; +fffiltergraph(graph)->sink_links = sinks; +fffiltergraph(graph)->sink_links_count = sink_links_count; return 0; } @@ -1395,7 +1395,7 @@ int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const return 0; } -static void heap_bubble_up(AVFilterGraph *graph, +static void heap_bubble_up(FFFilterGraph *graph, AVFilterLink *link, int index) { AVFilterLink **links = graph->sink_links; @@ -1414,7 +1414,7 @@ static void heap_bubble_up(AVFilterGraph *graph, link->age_index = index; } -static void heap_bubble_down(AVFilterGraph *graph, +static void heap_bubble_down(FFFilterGraph *graph, AVFilterLink *link, int index) { AVFilterLink **links = graph->sink_links; @@ -1440,18 +1440,20 @@ static void heap_bubble_down(AVFilterGraph *graph, void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link) { -heap_bubble_up (graph, link, link->age_index); -heap_bubble_down(graph, link, link->age_index); +FFFilterGraph *graphi = fffiltergraph(graph); +heap_bubble_up (graphi, link, link->age_index); +heap_bubble_down(graphi, link, link->age_index); } int avfilter_graph_request_oldest(AVFilterGraph *graph) { -AVFilterLink *oldest = graph->sink_links[0]; +FFFilterGraph *graphi = fffiltergraph(graph); +AVFilterLink *oldest = graphi->sink_links[0]; int64_t frame_count; int r; -while (graph->sink_links_count) { -oldest = graph->sink_links[0]; +while (graphi->sink_links_count) { +oldest = graphi->sink_links[0]; if (oldest->dst->filter->activate) { r = av_buffersink_get_frame_flags(oldest->dst, NULL, AV_BUFFERSINK_FLAG_PEEK); @@ -1466,12 +1468,12 @@ int avfilter_graph_request_oldest(AVFilterGraph *graph) oldest->dst->name, oldest->dstpad->name); /* EOF: remove the link from the heap */ -if (oldest->age_index <
[FFmpeg-devel] [PATCH 32/35] avfilter/af_hdcd: Drop a redundant log
avfilter_insert_filter() already reports (also with AV_LOG_VERBOSE) when a filter is auto-inserted. Signed-off-by: Andreas Rheinhardt --- Can be applied at any time. libavfilter/af_hdcd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavfilter/af_hdcd.c b/libavfilter/af_hdcd.c index a03c9aadf7..9cd483cfc4 100644 --- a/libavfilter/af_hdcd.c +++ b/libavfilter/af_hdcd.c @@ -1714,9 +1714,6 @@ static int config_input(AVFilterLink *inlink) { HDCDContext *s = ctx->priv; int c; -av_log(ctx, AV_LOG_VERBOSE, "Auto-convert: %s\n", -(ctx->graph->disable_auto_convert) ? "disabled" : "enabled"); - if ((inlink->format == AV_SAMPLE_FMT_S16 || inlink->format == AV_SAMPLE_FMT_S16P) && s->bits_per_sample != 16) { -- 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".
[FFmpeg-devel] [PATCH 31/35] avfilter/avfiltergraph: Avoid allocation for AVFilterGraphInternal
To do this, allocate AVFilterGraphInternal jointly with AVFilterGraph and rename it to FFFilterGraph in the process (similarly to AVStream/FFStream). Signed-off-by: Andreas Rheinhardt --- libavfilter/avfilter.c | 6 +++--- libavfilter/avfilter.h | 7 --- libavfilter/avfilter_internal.h | 17 + libavfilter/avfiltergraph.c | 32 +++- libavfilter/pthread.c | 23 --- 5 files changed, 43 insertions(+), 42 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 85e2936e6e..af46011b27 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -187,7 +187,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, av_assert0(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1); link->format = -1; link->colorspace = AVCOL_SPC_UNSPECIFIED; -ff_framequeue_init(>fifo, >graph->internal->frame_queues); +ff_framequeue_init(>fifo, (src->graph)->frame_queues); return 0; } @@ -888,9 +888,9 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options) if (ctx->filter->flags & AVFILTER_FLAG_SLICE_THREADS && ctx->thread_type & ctx->graph->thread_type & AVFILTER_THREAD_SLICE && -ctx->graph->internal->thread_execute) { +fffiltergraph(ctx->graph)->thread_execute) { ctx->thread_type = AVFILTER_THREAD_SLICE; -ctxi->execute= ctx->graph->internal->thread_execute; +ctxi->execute= fffiltergraph(ctx->graph)->thread_execute; } else { ctx->thread_type = 0; } diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index a3725b1516..65034f831a 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -843,8 +843,6 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, */ const AVClass *avfilter_get_class(void); -typedef struct AVFilterGraphInternal AVFilterGraphInternal; - /** * A function pointer passed to the @ref AVFilterGraph.execute callback to be * executed multiple times, possibly in parallel. @@ -902,11 +900,6 @@ typedef struct AVFilterGraph { */ int nb_threads; -/** - * Opaque object for libavfilter internal use. - */ -AVFilterGraphInternal *internal; - /** * Opaque user data. May be set by the caller to an arbitrary value, e.g. to * be used from callbacks like @ref AVFilterGraph.execute. diff --git a/libavfilter/avfilter_internal.h b/libavfilter/avfilter_internal.h index 3dd51fb993..9ddb82bf26 100644 --- a/libavfilter/avfilter_internal.h +++ b/libavfilter/avfilter_internal.h @@ -36,11 +36,20 @@ typedef struct AVFilterCommand { struct AVFilterCommand *next; } AVFilterCommand; -struct AVFilterGraphInternal { +typedef struct FFFilterGraph { +/** + * The public AVFilterGraph. See avfilter.h for it. + */ +AVFilterGraph p; void *thread; avfilter_execute_func *thread_execute; FFFrameQueueGlobal frame_queues; -}; +} FFFilterGraph; + +static inline FFFilterGraph *fffiltergraph(AVFilterGraph *graph) +{ +return (FFFilterGraph*)graph; +} /** * Update the position of a link in the age heap. @@ -77,8 +86,8 @@ int ff_filter_activate(AVFilterContext *filter); int ff_filter_opt_parse(void *logctx, const AVClass *priv_class, AVDictionary **options, const char *args); -int ff_graph_thread_init(AVFilterGraph *graph); +int ff_graph_thread_init(FFFilterGraph *graph); -void ff_graph_thread_free(AVFilterGraph *graph); +void ff_graph_thread_free(FFFilterGraph *graph); #endif /* AVFILTER_AVFILTER_INTERNAL_H */ diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 193fafe61c..0e2b5ee1f2 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -68,33 +68,30 @@ static const AVClass filtergraph_class = { }; #if !HAVE_THREADS -void ff_graph_thread_free(AVFilterGraph *graph) +void ff_graph_thread_free(FFFilterGraph *graph) { } -int ff_graph_thread_init(AVFilterGraph *graph) +int ff_graph_thread_init(FFFilterGraph *graph) { -graph->thread_type = 0; -graph->nb_threads = 1; +graph->p.thread_type = 0; +graph->p.nb_threads = 1; return 0; } #endif AVFilterGraph *avfilter_graph_alloc(void) { -AVFilterGraph *ret = av_mallocz(sizeof(*ret)); -if (!ret) -return NULL; +FFFilterGraph *graph = av_mallocz(sizeof(*graph)); +AVFilterGraph *ret; -ret->internal = av_mallocz(sizeof(*ret->internal)); -if (!ret->internal) { -av_freep(); +if (!graph) return NULL; -} +ret = >p; ret->av_class = _class; av_opt_set_defaults(ret); -ff_framequeue_global_init(>internal->frame_queues); +ff_framequeue_global_init(>frame_queues); return ret; } @@ -120,6 +117,7 @@ void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter void avfilter_graph_free(AVFilterGraph
[FFmpeg-devel] [PATCH 30/35] avfilter/avfiltergraph: Avoid indirection when freeing filtergraph
Signed-off-by: Andreas Rheinhardt --- libavfilter/avfiltergraph.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index c6f94bf0a8..193fafe61c 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -117,23 +117,25 @@ void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter } } -void avfilter_graph_free(AVFilterGraph **graph) +void avfilter_graph_free(AVFilterGraph **graphp) { -if (!*graph) +AVFilterGraph *graph = *graphp; + +if (!graph) return; -while ((*graph)->nb_filters) -avfilter_free((*graph)->filters[0]); +while (graph->nb_filters) +avfilter_free(graph->filters[0]); -ff_graph_thread_free(*graph); +ff_graph_thread_free(graph); -av_freep(&(*graph)->sink_links); +av_freep(>sink_links); -av_opt_free(*graph); +av_opt_free(graph); -av_freep(&(*graph)->filters); -av_freep(&(*graph)->internal); -av_freep(graph); +av_freep(>filters); +av_freep(>internal); +av_freep(graphp); } int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt, -- 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".
[FFmpeg-devel] [PATCH 29/35] avfilter: Add a header for internal generic-layer APIs
This commit moves the generic-layer stuff (that is not used by filters) to a new header of its own, similarly to 5e7b5b0090bdf68e0897fe55ee657fdccc0cbca2 for libavcodec. Signed-off-by: Andreas Rheinhardt --- If buffersrc/sink were to be treated as part of the generic layer, the declarations of ff_avfilter_link_set_in_status and ff_filter_graph_run_once would also be moved. libavfilter/avfilter.c | 1 + libavfilter/avfilter_internal.h | 84 + libavfilter/avfiltergraph.c | 2 +- libavfilter/graphparser.c | 1 + libavfilter/internal.h | 50 libavfilter/pthread.c | 3 +- libavfilter/thread.h| 28 --- 7 files changed, 88 insertions(+), 81 deletions(-) create mode 100644 libavfilter/avfilter_internal.h delete mode 100644 libavfilter/thread.h diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index dbe6409274..85e2936e6e 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -39,6 +39,7 @@ #include "audio.h" #include "avfilter.h" +#include "avfilter_internal.h" #include "filters.h" #include "formats.h" #include "framepool.h" diff --git a/libavfilter/avfilter_internal.h b/libavfilter/avfilter_internal.h new file mode 100644 index 00..3dd51fb993 --- /dev/null +++ b/libavfilter/avfilter_internal.h @@ -0,0 +1,84 @@ +/* + * 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 + */ + +/* + * APIs internal to the generic filter(graph) layer. + * + * MUST NOT be included by individual filters. + */ + +#ifndef AVFILTER_AVFILTER_INTERNAL_H +#define AVFILTER_AVFILTER_INTERNAL_H + +#include "avfilter.h" +#include "framequeue.h" + +typedef struct AVFilterCommand { +double time;///< time expressed in seconds +char *command; ///< command +char *arg; ///< optional argument for the command +int flags; +struct AVFilterCommand *next; +} AVFilterCommand; + +struct AVFilterGraphInternal { +void *thread; +avfilter_execute_func *thread_execute; +FFFrameQueueGlobal frame_queues; +}; + +/** + * Update the position of a link in the age heap. + */ +void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link); + +/** + * Allocate a new filter context and return it. + * + * @param filter what filter to create an instance of + * @param inst_name name to give to the new filter context + * + * @return newly created filter context or NULL on failure + */ +AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name); + +/** + * Remove a filter from a graph; + */ +void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter); + +int ff_filter_activate(AVFilterContext *filter); + +/** + * Parse filter options into a dictionary. + * + * @param logctx context for logging + * @param priv_class a filter's private class for shorthand options or NULL + * @param options dictionary to store parsed options in + * @param args options string to parse + * + * @return a non-negative number on success, a negative error code on failure + */ +int ff_filter_opt_parse(void *logctx, const AVClass *priv_class, +AVDictionary **options, const char *args); + +int ff_graph_thread_init(AVFilterGraph *graph); + +void ff_graph_thread_free(AVFilterGraph *graph); + +#endif /* AVFILTER_AVFILTER_INTERNAL_H */ diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index a43c23065c..c6f94bf0a8 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -36,10 +36,10 @@ #include "framequeue.h" #include "avfilter.h" +#include "avfilter_internal.h" #include "buffersink.h" #include "formats.h" #include "internal.h" -#include "thread.h" #define OFFSET(x) offsetof(AVFilterGraph, x) #define F AV_OPT_FLAG_FILTERING_PARAM diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 229e647c0a..5d6dcdb9d3 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -29,6 +29,7 @@ #include "libavutil/opt.h" #include "avfilter.h" +#include "avfilter_internal.h" #include "internal.h" #define WHITESPACES " \n\t\r" diff --git a/libavfilter/internal.h b/libavfilter/internal.h index 3d46923cad..0e3f68d1f4
[FFmpeg-devel] [PATCH 28/35] avfilter/avfilter: Avoid allocation for AVFilterInternal
To do this, allocate AVFilterInternal jointly with AVFilterContext and rename it to FFFilterContext in the process (similarly to AVStream/FFStream). Signed-off-by: Andreas Rheinhardt --- libavfilter/avfilter.c| 22 ++ libavfilter/avfilter.h| 7 --- libavfilter/graphparser.c | 2 +- libavfilter/internal.h| 16 +--- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index befcda48cb..dbe6409274 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -159,7 +159,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, src->outputs[srcpad] || dst->inputs[dstpad]) return AVERROR(EINVAL); -if (!src->internal->initialized || !dst->internal->initialized) { +if (!fffilterctx(src)->initialized || !fffilterctx(dst)->initialized) { av_log(src, AV_LOG_ERROR, "Filters must be initialized before linking.\n"); return AVERROR(EINVAL); } @@ -651,15 +651,17 @@ static int default_execute(AVFilterContext *ctx, avfilter_action_func *func, voi AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name) { +FFFilterContext *ctx; AVFilterContext *ret; int preinited = 0; if (!filter) return NULL; -ret = av_mallocz(sizeof(AVFilterContext)); -if (!ret) +ctx = av_mallocz(sizeof(*ctx)); +if (!ctx) return NULL; +ret = >p; ret->av_class = _class; ret->filter = filter; @@ -681,10 +683,7 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name) av_opt_set_defaults(ret->priv); } -ret->internal = av_mallocz(sizeof(*ret->internal)); -if (!ret->internal) -goto err; -ret->internal->execute = default_execute; +ctx->execute = default_execute; ret->nb_inputs = filter->nb_inputs; if (ret->nb_inputs ) { @@ -718,7 +717,6 @@ err: av_freep(>output_pads); ret->nb_outputs = 0; av_freep(>priv); -av_freep(>internal); av_free(ret); return NULL; } @@ -790,7 +788,6 @@ void avfilter_free(AVFilterContext *filter) av_expr_free(filter->enable); filter->enable = NULL; av_freep(>var_values); -av_freep(>internal); av_free(filter); } @@ -874,9 +871,10 @@ int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options) { +FFFilterContext *ctxi = fffilterctx(ctx); int ret = 0; -if (ctx->internal->initialized) { +if (ctxi->initialized) { av_log(ctx, AV_LOG_ERROR, "Filter already initialized\n"); return AVERROR(EINVAL); } @@ -891,7 +889,7 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options) ctx->thread_type & ctx->graph->thread_type & AVFILTER_THREAD_SLICE && ctx->graph->internal->thread_execute) { ctx->thread_type = AVFILTER_THREAD_SLICE; -ctx->internal->execute = ctx->graph->internal->thread_execute; +ctxi->execute= ctx->graph->internal->thread_execute; } else { ctx->thread_type = 0; } @@ -907,7 +905,7 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options) return ret; } -ctx->internal->initialized = 1; +ctxi->initialized = 1; return 0; } diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index a5d9398c9a..a3725b1516 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -403,8 +403,6 @@ unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output); */ #define AVFILTER_THREAD_SLICE (1 << 0) -typedef struct AVFilterInternal AVFilterInternal; - /** An instance of a filter */ struct AVFilterContext { const AVClass *av_class;///< needed for av_log() and filters common options @@ -443,11 +441,6 @@ struct AVFilterContext { */ int thread_type; -/** - * An opaque struct for libavfilter internal use. - */ -AVFilterInternal *internal; - struct AVFilterCommand *command_queue; char *enable_str; ///< enable expression string diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 96ef6b15bf..229e647c0a 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -626,7 +626,7 @@ int avfilter_graph_segment_init(AVFilterGraphSegment *seg, int flags) if (p->filter_name) return fail_creation_pending(seg, p->filter_name, __func__); -if (!p->filter || p->filter->internal->initialized) +if (!p->filter || fffilterctx(p->filter)->initialized) continue; ret = avfilter_init_dict(p->filter, NULL); diff --git a/libavfilter/internal.h b/libavfilter/internal.h index a6cdf9994c..3d46923cad 100644 --- a/libavfilter/internal.h +++ b/libavfilter/internal.h @@ -133,18 +133,28 @@ struct
[FFmpeg-devel] [PATCH v2 3/3] lavc/dxv: remove ctx fields that can be derived from texdsp ctxs
Signed-off-by: Connor Worley --- libavcodec/dxv.c | 53 1 file changed, 9 insertions(+), 44 deletions(-) diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index cd78de3e0d..82c493f1de 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -39,20 +39,12 @@ typedef struct DXVContext { uint8_t *tex_data; // Compressed texture uint8_t *ctex_data; // Compressed chroma texture -int tex_rat; // Compression ratio -int tex_step;// Distance between blocks -int ctex_step; // Distance between blocks + int64_t tex_size;// Texture size int64_t ctex_size; // Chroma texture size uint8_t *op_data[4]; // Opcodes int64_t op_size[4]; // Opcodes size - -int texture_block_w; -int texture_block_h; - -int ctexture_block_w; -int ctexture_block_h; } DXVContext; /* This scheme addresses already decoded elements depending on 2-bit status: @@ -865,9 +857,6 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, cavctx.coded_height = avctx->coded_height / 2; cavctx.coded_width = avctx->coded_width / 2; -ctx->texture_block_h = 4; -ctx->texture_block_w = 4; - avctx->pix_fmt = AV_PIX_FMT_RGBA; avctx->colorspace = AVCOL_SPC_RGB; @@ -878,8 +867,6 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, texdsp_ctx.tex_funct = ctx->texdsp.dxt1_block; texdsp_ctx.tex_ratio = 8; texdsp_ctx.raw_ratio = 16; -ctx->tex_rat = 8; -ctx->tex_step = 8; msgcomp = "DXTR1"; msgtext = "DXT1"; break; @@ -889,8 +876,6 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, texdsp_ctx.tex_funct = ctx->texdsp.dxt4_block; texdsp_ctx.tex_ratio = 16; texdsp_ctx.raw_ratio = 16; -ctx->tex_rat = 4; -ctx->tex_step = 16; msgcomp = "DXTR5"; msgtext = "DXT5"; break; @@ -902,16 +887,8 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, ctexdsp_ctx.tex_funct = ctx->texdsp.rgtc1u_gray_block; ctexdsp_ctx.tex_ratio = 16; ctexdsp_ctx.raw_ratio = 4; -ctx->tex_rat = 8; -ctx->tex_step = 32; -ctx->ctex_step = 16; msgcomp = "YOCOCG6"; msgtext = "YCG6"; -ctx->ctex_size = avctx->coded_width * avctx->coded_height / 4; -ctx->texture_block_h = 4; -ctx->texture_block_w = 16; -ctx->ctexture_block_h = 4; -ctx->ctexture_block_w = 4; avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->colorspace = AVCOL_SPC_YCOCG; break; @@ -923,16 +900,8 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, ctexdsp_ctx.tex_funct = ctx->texdsp.rgtc1u_gray_block; ctexdsp_ctx.tex_ratio = 16; ctexdsp_ctx.raw_ratio = 4; -ctx->tex_rat = 4; -ctx->tex_step = 64; -ctx->ctex_step = 16; msgcomp = "YAOCOCG10"; msgtext = "YG10"; -ctx->ctex_size = avctx->coded_width * avctx->coded_height / 4; -ctx->texture_block_h = 4; -ctx->texture_block_w = 16; -ctx->ctexture_block_h = 4; -ctx->ctexture_block_w = 4; avctx->pix_fmt = AV_PIX_FMT_YUVA420P; avctx->colorspace = AVCOL_SPC_YCOCG; break; @@ -957,7 +926,6 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, texdsp_ctx.tex_funct = ctx->texdsp.dxt5_block; texdsp_ctx.tex_ratio = 16; texdsp_ctx.raw_ratio = 16; -ctx->tex_step = 16; } else if (old_type & 0x20 || version_major == 1) { tag = DXV_FMT_DXT1; msgtext = "DXT1"; @@ -965,12 +933,10 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, texdsp_ctx.tex_funct = ctx->texdsp.dxt1_block; texdsp_ctx.tex_ratio = 8; texdsp_ctx.raw_ratio = 16; -ctx->tex_step = 8; } else { av_log(avctx, AV_LOG_ERROR, "Unsupported header (0x%08"PRIX32")\n.", tag); return AVERROR_INVALIDDATA; } -ctx->tex_rat = 1; break; } @@ -986,7 +952,6 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, /* Encoder copies texture data when compression is not advantageous. */ if (bytestream2_get_byte(gbc)) { msgcomp = "RAW"; -ctx->tex_rat = 1; decompress_tex = dxv_decompress_raw; } @@ -1004,14 +969,20 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, return AVERROR_INVALIDDATA; } -ctx->tex_size = avctx->coded_width * avctx->coded_height * 4 / ctx->tex_rat; +ctx->tex_size = avctx->coded_width / (texdsp_ctx.raw_ratio / (avctx->pix_fmt == AV_PIX_FMT_RGBA ? 4 : 1)) * +avctx->coded_height / TEXTURE_BLOCK_H * +texdsp_ctx.tex_ratio; ret =
[FFmpeg-devel] [PATCH v2 2/3] lavc/dvx: use texdsp funcs for texture block decompression
Signed-off-by: Connor Worley --- libavcodec/dxv.c | 289 --- 1 file changed, 75 insertions(+), 214 deletions(-) diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index 16c34fff3b..cd78de3e0d 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -38,15 +38,12 @@ typedef struct DXVContext { GetByteContext gbc; uint8_t *tex_data; // Compressed texture -uint8_t *ctex_data; // Compressed texture +uint8_t *ctex_data; // Compressed chroma texture int tex_rat; // Compression ratio int tex_step;// Distance between blocks int ctex_step; // Distance between blocks int64_t tex_size;// Texture size -int64_t ctex_size; // Texture size - -/* Optimal number of slices for parallel decoding */ -int slice_count; +int64_t ctex_size; // Chroma texture size uint8_t *op_data[4]; // Opcodes int64_t op_size[4]; // Opcodes size @@ -56,198 +53,8 @@ typedef struct DXVContext { int ctexture_block_w; int ctexture_block_h; - -/* Pointer to the selected decompression function */ -int (*tex_funct)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block); -int (*tex_funct_planar[2])(uint8_t *plane0, ptrdiff_t stride0, - uint8_t *plane1, ptrdiff_t stride1, - const uint8_t *block); } DXVContext; -static void decompress_indices(uint8_t *dst, const uint8_t *src) -{ -int block, i; - -for (block = 0; block < 2; block++) { -int tmp = AV_RL24(src); - -/* Unpack 8x3 bit from last 3 byte block */ -for (i = 0; i < 8; i++) -dst[i] = (tmp >> (i * 3)) & 0x7; - -src += 3; -dst += 8; -} -} - -static int extract_component(int yo0, int yo1, int code) -{ -int yo; - -if (yo0 == yo1) { -yo = yo0; -} else if (code == 0) { -yo = yo0; -} else if (code == 1) { -yo = yo1; -} else { -if (yo0 > yo1) { -yo = (uint8_t) (((8 - code) * yo0 + - (code - 1) * yo1) / 7); -} else { -if (code == 6) { -yo = 0; -} else if (code == 7) { -yo = 255; -} else { -yo = (uint8_t) (((6 - code) * yo0 + - (code - 1) * yo1) / 5); -} -} -} - -return yo; -} - -static int cocg_block(uint8_t *plane0, ptrdiff_t stride0, - uint8_t *plane1, ptrdiff_t stride1, - const uint8_t *block) -{ -uint8_t co_indices[16]; -uint8_t cg_indices[16]; -uint8_t co0 = *(block); -uint8_t co1 = *(block + 1); -uint8_t cg0 = *(block + 8); -uint8_t cg1 = *(block + 9); -int x, y; - -decompress_indices(co_indices, block + 2); -decompress_indices(cg_indices, block + 10); - -for (y = 0; y < 4; y++) { -for (x = 0; x < 4; x++) { -int co_code = co_indices[x + y * 4]; -int cg_code = cg_indices[x + y * 4]; - -plane0[x] = extract_component(cg0, cg1, cg_code); -plane1[x] = extract_component(co0, co1, co_code); -} -plane0 += stride0; -plane1 += stride1; -} - -return 16; -} - -static void yao_subblock(uint8_t *dst, uint8_t *yo_indices, -ptrdiff_t stride, const uint8_t *block) -{ -uint8_t yo0 = *(block); -uint8_t yo1 = *(block + 1); -int x, y; - -decompress_indices(yo_indices, block + 2); - -for (y = 0; y < 4; y++) { -for (x = 0; x < 4; x++) { -int yo_code = yo_indices[x + y * 4]; - -dst[x] = extract_component(yo0, yo1, yo_code); -} -dst += stride; -} -} - -static int yo_block(uint8_t *dst, ptrdiff_t stride, -uint8_t *unused0, ptrdiff_t unused1, -const uint8_t *block) -{ -uint8_t yo_indices[16]; - -yao_subblock(dst, yo_indices, stride, block); -yao_subblock(dst + 4, yo_indices, stride, block + 8); -yao_subblock(dst + 8, yo_indices, stride, block + 16); -yao_subblock(dst + 12, yo_indices, stride, block + 24); - -return 32; -} - -static int yao_block(uint8_t *plane0, ptrdiff_t stride0, - uint8_t *plane3, ptrdiff_t stride1, - const uint8_t *block) -{ -uint8_t yo_indices[16]; -uint8_t a_indices[16]; - -yao_subblock(plane0, yo_indices, stride0, block); -yao_subblock(plane3, a_indices, stride1, block + 8); -yao_subblock(plane0 + 4, yo_indices, stride0, block + 16); -yao_subblock(plane3 + 4, a_indices, stride1, block + 24); -yao_subblock(plane0 + 8, yo_indices, stride0, block + 32); -yao_subblock(plane3 + 8, a_indices, stride1, block + 40); -yao_subblock(plane0 + 12, yo_indices, stride0, block + 48); -yao_subblock(plane3 + 12, a_indices, stride1, block + 56); - -return 64; -} -
[FFmpeg-devel] [PATCH v2 1/3] lavc/dxv: move tag definitions to common header
Signed-off-by: Connor Worley --- libavcodec/dxv.c| 9 + libavcodec/dxv.h| 34 ++ libavcodec/dxvenc.c | 7 ++- 3 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 libavcodec/dxv.h diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index 9261a5cac1..16c34fff3b 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -28,6 +28,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "dxv.h" #include "lzf.h" #include "texturedsp.h" #include "thread.h" @@ -1064,7 +1065,7 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, tag = bytestream2_get_le32(gbc); switch (tag) { -case MKBETAG('D', 'X', 'T', '1'): +case DXV_FMT_DXT1: decompress_tex = dxv_decompress_dxt1; ctx->tex_funct = ctx->texdsp.dxt1_block; ctx->tex_rat = 8; @@ -1072,7 +1073,7 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, msgcomp = "DXTR1"; msgtext = "DXT1"; break; -case MKBETAG('D', 'X', 'T', '5'): +case DXV_FMT_DXT5: decompress_tex = dxv_decompress_dxt5; /* DXV misnomers DXT5, alpha is premultiplied so use DXT4 instead */ ctx->tex_funct = ctx->texdsp.dxt4_block; @@ -1081,7 +1082,7 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, msgcomp = "DXTR5"; msgtext = "DXT5"; break; -case MKBETAG('Y', 'C', 'G', '6'): +case DXV_FMT_YCG6: decompress_tex = dxv_decompress_ycg6; ctx->tex_funct_planar[0] = yo_block; ctx->tex_funct_planar[1] = cocg_block; @@ -1098,7 +1099,7 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->colorspace = AVCOL_SPC_YCOCG; break; -case MKBETAG('Y', 'G', '1', '0'): +case DXV_FMT_YG10: decompress_tex = dxv_decompress_yg10; ctx->tex_funct_planar[0] = yao_block; ctx->tex_funct_planar[1] = cocg_block; diff --git a/libavcodec/dxv.h b/libavcodec/dxv.h new file mode 100644 index 00..71cfddec85 --- /dev/null +++ b/libavcodec/dxv.h @@ -0,0 +1,34 @@ +/* + * Resolume DXV common + * Copyright (C) 2024 Connor Worley + * + * 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_DXV_H +#define AVCODEC_DXV_H + +#include "libavutil/macros.h" + +typedef enum DXVTextureFormat { +DXV_FMT_DXT1 = MKBETAG('D', 'X', 'T', '1'), +DXV_FMT_DXT5 = MKBETAG('D', 'X', 'T', '5'), +DXV_FMT_YCG6 = MKBETAG('Y', 'C', 'G', '6'), +DXV_FMT_YG10 = MKBETAG('Y', 'G', '1', '0'), +} DXVTextureFormat; + +#endif /* AVCODEC_DXV_H */ diff --git a/libavcodec/dxvenc.c b/libavcodec/dxvenc.c index 33a18d53d8..bb2c2f8526 100644 --- a/libavcodec/dxvenc.c +++ b/libavcodec/dxvenc.c @@ -27,6 +27,7 @@ #include "bytestream.h" #include "codec_internal.h" +#include "dxv.h" #include "encode.h" #include "texturedsp.h" @@ -40,10 +41,6 @@ #define LOOKBACK_HT_ELEMS 0x4 #define LOOKBACK_WORDS0x20202 -enum DXVTextureFormat { -DXV_FMT_DXT1 = MKBETAG('D', 'X', 'T', '1'), -}; - typedef struct HTEntry { uint32_t key; uint32_t pos; @@ -120,7 +117,7 @@ typedef struct DXVEncContext { TextureDSPThreadContext enc; -enum DXVTextureFormat tex_fmt; +DXVTextureFormat tex_fmt; int (*compress_tex)(AVCodecContext *avctx); const AVCRC *crc_ctx; -- 2.43.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 v3 2/2] lavc/vulkan_av1: port to the new stable API
Most of this patch was written by Dave Airlie , with some additions by me. >From be1b73147c92a8f74e5cdf30e5325382a6f77799 Mon Sep 17 00:00:00 2001 From: Lynne Date: Fri, 19 Jan 2024 10:49:02 +1000 Subject: [PATCH v3 2/2] lavc/vulkan_av1: port to the new stable API Most of this patch was written by Dave Airlie , with some additions by me. --- libavcodec/Makefile | 3 +- libavcodec/vulkan_av1.c | 462 ++ libavcodec/vulkan_decode.c| 24 +- libavcodec/vulkan_decode.h| 2 +- libavcodec/vulkan_video.c | 33 +- libavcodec/vulkan_video.h | 3 +- libavcodec/vulkan_video_codec_av1std.h| 403 --- libavcodec/vulkan_video_codec_av1std_decode.h | 36 -- libavutil/hwcontext_vulkan.c | 2 +- libavutil/vulkan_functions.h | 2 +- libavutil/vulkan_loader.h | 2 +- 11 files changed, 303 insertions(+), 669 deletions(-) delete mode 100644 libavcodec/vulkan_video_codec_av1std.h delete mode 100644 libavcodec/vulkan_video_codec_av1std_decode.h diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 470d7cb9b1..581415f3b7 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1262,7 +1262,6 @@ SKIPHEADERS+= %_tablegen.h \ aacenc_quantization.h \ aacenc_quantization_misc.h\ bitstream_template.h \ - vulkan_video_codec_av1std.h \ $(ARCH)/vpx_arith.h \ SKIPHEADERS-$(CONFIG_AMF) += amfenc.h @@ -1285,7 +1284,7 @@ SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h SKIPHEADERS-$(CONFIG_VAAPI)+= vaapi_decode.h vaapi_hevc.h vaapi_encode.h SKIPHEADERS-$(CONFIG_VDPAU)+= vdpau.h vdpau_internal.h SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vt_internal.h -SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h vulkan_video_codec_av1std_decode.h +SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h v4l2_m2m.h SKIPHEADERS-$(CONFIG_ZLIB) += zlib_wrapper.h diff --git a/libavcodec/vulkan_av1.c b/libavcodec/vulkan_av1.c index 9730e4b08d..3dcad57f21 100644 --- a/libavcodec/vulkan_av1.c +++ b/libavcodec/vulkan_av1.c @@ -35,18 +35,33 @@ typedef struct AV1VulkanDecodePicture { *Can be removed once no longer needed, and threading can be enabled. */ FFVulkanDecodeContext *dec; -StdVideoAV1MESATiletiles[MAX_TILES]; -StdVideoAV1MESATileListtile_list; -const uint32_t*tile_offsets; +uint32_t tile_count; +uint32_t tile_offsets_s[MAX_TILES]; +uint32_t tile_sizes[MAX_TILES]; +const uint32_t *tile_offsets; /* Current picture */ -VkVideoDecodeAV1DpbSlotInfoMESAvkav1_ref; -StdVideoAV1MESAFrameHeader av1_frame_header; -VkVideoDecodeAV1PictureInfoMESAav1_pic_info; +StdVideoDecodeAV1ReferenceInfo std_ref; +VkVideoDecodeAV1DpbSlotInfoKHR vkav1_ref; +uint16_t width_in_sbs_minus1[64]; +uint16_t height_in_sbs_minus1[64]; +uint16_t mi_col_starts[64]; +uint16_t mi_row_starts[64]; +StdVideoAV1TileInfo tile_info; +StdVideoAV1Quantization quantization; +StdVideoAV1Segmentation segmentation; +StdVideoAV1LoopFilter loop_filter; +StdVideoAV1CDEF cdef; +StdVideoAV1LoopRestoration loop_restoration; +StdVideoAV1GlobalMotion global_motion; +StdVideoAV1FilmGrain film_grain; +StdVideoDecodeAV1PictureInfostd_pic_info; +VkVideoDecodeAV1PictureInfoKHR av1_pic_info; /* Picture refs */ const AV1Frame *ref_src [AV1_NUM_REF_FRAMES]; -VkVideoDecodeAV1DpbSlotInfoMESA vkav1_refs[AV1_NUM_REF_FRAMES]; +StdVideoDecodeAV1ReferenceInfo std_ref_info[AV1_NUM_REF_FRAMES]; +VkVideoDecodeAV1DpbSlotInfoKHR vkav1_refs[AV1_NUM_REF_FRAMES]; uint8_t frame_id_set; uint8_t frame_id; @@ -55,44 +70,65 @@ typedef struct AV1VulkanDecodePicture { static int vk_av1_fill_pict(AVCodecContext *avctx, const AV1Frame **ref_src, VkVideoReferenceSlotInfoKHR *ref_slot, /* Main structure */ VkVideoPictureResourceInfoKHR *ref, /* Goes in ^ */ -VkVideoDecodeAV1DpbSlotInfoMESA *vkav1_ref, /* Goes in ^ */ -const AV1Frame *pic, int is_current, int has_grain, -int dpb_slot_index) +StdVideoDecodeAV1ReferenceInfo *vkav1_std_ref, +
[FFmpeg-devel] [PATCH v3 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias and order_hints
Needed for Vulkan AV1. >From 841ede35a2fdb76ef31a5018a98a16384837d50a Mon Sep 17 00:00:00 2001 From: Lynne Date: Fri, 2 Feb 2024 03:54:06 +0100 Subject: [PATCH v3 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias and order_hints Needed for Vulkan AV1. --- libavcodec/cbs_av1.h | 2 ++ libavcodec/cbs_av1_syntax_template.c | 11 +++ 2 files changed, 13 insertions(+) diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h index a5402f069d..0ed49e03ca 100644 --- a/libavcodec/cbs_av1.h +++ b/libavcodec/cbs_av1.h @@ -465,6 +465,8 @@ typedef struct CodedBitstreamAV1Context { int tile_num; AV1ReferenceFrameState ref[AV1_NUM_REF_FRAMES]; +uint8_t ref_frame_sign_bias[AV1_TOTAL_REFS_PER_FRAME]; +uint8_t order_hints[AV1_TOTAL_REFS_PER_FRAME]; // AVOptions int operating_point; diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c index 3be1f2d30f..20eed7ff9e 100644 --- a/libavcodec/cbs_av1_syntax_template.c +++ b/libavcodec/cbs_av1_syntax_template.c @@ -1572,6 +1572,17 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, } if (!frame_is_intra) { +for (i = 0; i < AV1_REFS_PER_FRAME; i++) { +uint8_t ref_frame = AV1_REF_FRAME_LAST + i; +if (seq->enable_order_hint) { +uint8_t hint = current->ref_order_hint[current->ref_frame_idx[i]]; +uint8_t sign_bias = cbs_av1_get_relative_dist(seq, hint, priv->order_hint) > 0; +priv->order_hints[ref_frame] = hint; +priv->ref_frame_sign_bias[ref_frame] = sign_bias; +} else { +priv->ref_frame_sign_bias[ref_frame] = 0; +} +} // Derive reference frame sign biases. } -- 2.43.0.381.gb435a96ce8 ___ 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] Call for SOWs [due Feb 10 at 23:59 UTC]
Hi all just a reminder, please submit your SoWs! thx On Wed, Feb 07, 2024 at 10:02:43PM -0800, Pierre-Anthony Lemieux wrote: > Hi all, > > Below is a proposal for creating a proposal to the STF -- I offered to > Michael to help, and here we are. > > The objective, as I understand it, is to unlock funds for individuals > that are interested in contributing to the FFMPEG codebase, subject to > the STF criteria [1]. > > The suggested approach is that interested individuals email me, no > later than Feb 10 at 23:59 UTC, a completed SOW using the template at > [2]. > > It is important IMHO that there is a developer and a defined amount > attached to each SOW, otherwise it creates uncertainty and thus > increases the management burden and reduces the chances that the > proposal is accepted. It is also important that the aggregate value of > the SOWs is greater than €150,000 (minimum STF funding). This call for > SOWs is completely voluntary, there is no guarantee that all SOWs are > accepted by SPI, and the chances of success are unknown (to me). The > SOWs (minus personal information and amounts) will be published. > > I am happy to collate the SOWs and forward them to SPI, who would > handle the submission to STF and payments to contributors as the case > may be. I am also happy to be educated and proven wrong. I am also > happy to do nothing. > > Best, > > -- Pierre > > [1] https://www.sovereigntechfund.de/programs/applications#evaluation-criteria > [2] > https://docs.google.com/document/d/1unVsF5nwvKQ8rKbrEHN9NZIEvL73CV5zpB9OK0DrSG8 > ___ > 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". -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates 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".
Re: [FFmpeg-devel] [PATCH v2 1/2] lavu/hashtable: create generic robin hood hash table
On Wed, Feb 7, 2024 at 2:16 AM Andreas Rheinhardt < andreas.rheinha...@outlook.com> wrote: > Connor Worley: > > +#define ENTRY_PSL(entry) (entry) > > +#define ENTRY_OCC(entry) (ENTRY_PSL(entry) + sizeof(size_t)) > > +#define ENTRY_KEY(entry) (ENTRY_OCC(entry) + 4) > > +#define ENTRY_VAL(entry) (ENTRY_KEY(entry) + FFALIGN(ctx->key_size, 4)) > > + > > It seems you misunderstood what I said about alignment in my last > review. You should align entry_size and not align the size of key and > val fields. The way you are doing it now does not prevent unaligned > accesses: Imagine the common case of size_t having an alignment > requirement of 8 and key_size and val_size being four. Then entry_size > is not a multiple of 8 and therefore of two consecutive entries, only > one can be properly aligned (e.g. the second entry > ctx->table+ctx->entry_size is misaligned). > (For the same reason, the alignment of a struct is a multiple of the > alignment of every member of said struct.) > The way you are doing it also adds FFALIGN to every access to val. > Apologies as I don't usually write C. Is it not necessary to ensure val is aligned? Would aligning every field to sizeof(size_t) be sufficient for ensuring consecutive entries are aligned? I believe I would need to store a possibly rounded-up key_size to avoid the FFALIGN in val access. -- Connor Worley ___ 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] FFmpeg 7.0 blocking issues
On 1/23/2024 4:22 PM, Michael Niedermayer wrote: Hi all As it was a little difficult for me to not loose track of what is blocking a release. I suggest that for all release blocking issues open a ticket and set Blocking to 7.0 that way this: https://trac.ffmpeg.org/query?blocking=~7.0 or for the ones not closed: https://trac.ffmpeg.org/query?status=new=open=reopened=~7.0 will list all blocking issues Ive added one, for testing that, i intend to add more if i see something What is blocking? (IMHO) * regressions (unless its non possible to fix before release) * crashes * security issues * data loss * privacy issues * anything the commuity agrees should be in the release thx There are currently issues with the hevc decoder after some of the commits that shared code with the vvc decoder were pushed. You can see it by running the hevc conformance suite in FATE under GCC ubsan. Nuo Mi said he's looking at them, but if it takes him too much time we can revert the faulty commits before the release, in either master or even the actual release branch. ___ 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/avcodec: don't print coded dimensions if not set
The avctx passed to avcodec_string() may have unset coded dimensions, as is the case when called by av_dump_format() where the streams had all the needed information at the container level, and as such no frames were decoded internally. Signed-off-by: James Almer --- libavcodec/avcodec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index b6d27ada21..a13b781996 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -625,6 +625,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) enc->width, enc->height); if (av_log_get_level() >= AV_LOG_VERBOSE && +enc->coded_width && enc->coded_height && (enc->width != enc->coded_width || enc->height != enc->coded_height)) av_bprintf(, " (%dx%d)", -- 2.43.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] [PATCH 2/4] lavc/rv34dsp: R-V V rv34_inv_transform_dc
Happy new year ~ Yes, I've tried reordering. Rémi Denis-Courmont 于2024年2月10日周六 17:18写道: > Happy new year, > > The gains are -unsurprisingly- modest here. Did you try to reorder > instructions to improve scheduling? > > -- > Rémi Denis-Courmont > http://www.remlab.net/ > > > > ___ > 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] [PATCH 27/27] avformat/demux: Use enum AVCodecID for raw_codec_id
Signed-off-by: Andreas Rheinhardt --- libavformat/demux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/demux.h b/libavformat/demux.h index 41d1318f75..4e8d042e75 100644 --- a/libavformat/demux.h +++ b/libavformat/demux.h @@ -37,7 +37,7 @@ typedef struct FFInputFormat { /** * Raw demuxers store their codec ID here. */ -int raw_codec_id; +enum AVCodecID raw_codec_id; /** * Size of private data so that it can be allocated in the wrapper. -- 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".
[FFmpeg-devel] [PATCH 26/27] avutil/opt: Don't use AV_OPT_TYPE_FLAGS for sentinels
Make AVOptionType start with 1 instead. Signed-off-by: Andreas Rheinhardt --- One could also add an AV_OPT_TYPE_NONE. libavutil/opt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/opt.h b/libavutil/opt.h index 3ceb4f86eb..0f84cc53e1 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -221,7 +221,7 @@ */ enum AVOptionType{ -AV_OPT_TYPE_FLAGS, +AV_OPT_TYPE_FLAGS = 1, AV_OPT_TYPE_INT, AV_OPT_TYPE_INT64, AV_OPT_TYPE_DOUBLE, -- 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 v2 1/2] avcodec/vvc_mp4toannexb: check bytes left for nalu_len
Nuo Mi: > On Fri, Feb 9, 2024 at 7:40 PM Andreas Rheinhardt < > andreas.rheinha...@outlook.com> wrote: > >> Nuo Mi: >>> Fixes: fuzzer timeout >>> Fixes: >> 65253/clusterfuzz-testcase-minimized-ffmpeg_BSF_VVC_MP4TOANNEXB_fuzzer-4972412487467008 >>> >>> Found-by: continuous fuzzing process >> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg >>> Signed-off-by: Michael Niedermayer >>> Signed-off-by: Andreas Rheinhardt >>> --- >>> libavcodec/bsf/vvc_mp4toannexb.c | 7 --- >>> 1 file changed, 4 insertions(+), 3 deletions(-) >>> >>> diff --git a/libavcodec/bsf/vvc_mp4toannexb.c >> b/libavcodec/bsf/vvc_mp4toannexb.c >>> index 25c3726918..36bdae8f49 100644 >>> --- a/libavcodec/bsf/vvc_mp4toannexb.c >>> +++ b/libavcodec/bsf/vvc_mp4toannexb.c >>> @@ -155,10 +155,11 @@ static int vvc_extradata_to_annexb(AVBSFContext >> *ctx) >>> } >>> >>> for (j = 0; j < cnt; j++) { >>> -int nalu_len = bytestream2_get_be16(); >>> +const int nalu_len = bytestream2_get_be16(); >>> >>> -if (4 + AV_INPUT_BUFFER_PADDING_SIZE + nalu_len > >>> -SIZE_MAX - new_extradata_size) { >>> +if (!nalu_len || >>> +nalu_len > bytestream2_get_bytes_left() || >>> +4 + AV_INPUT_BUFFER_PADDING_SIZE + nalu_len > SIZE_MAX >> - new_extradata_size) { >>> ret = AVERROR_INVALIDDATA; >>> goto fail; >>> } >> >> What about growing the packet? >> > Hi Andreas, > Do you mean growing the packet only once for all nalus? > However, this would change the original behavior and result in more > duplicate code between the HEVC and VVC implementations. > I can do it, but I'll refactor duplications to h2656_mp4toannexb.c first. > Do you think that's okay? > Thank you > I meant a simple check before growing the packet to ensure that there is enough input left as the header claims there to be. Your original patch added such a check, so I presumed that there is none. But there is one (both here and in hevc_mp4toannexb). So my above point is moot. - 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".
[FFmpeg-devel] [PATCH] avfilter/vf_setparams: use YUV colorspace negotiation API
From: Niklas Haas When this filter overrides frame properties, the outgoing frames have a different YUV colorspace than the incoming ones. This requires signalling the new colorspace on the outlink, and in particular, making sure it's *not* set to a common ref with the input - otherwise the point of this filter would be destroyed. Untouched fields will continue being passed through, so we don't need to do anything there. --- libavfilter/vf_setparams.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/libavfilter/vf_setparams.c b/libavfilter/vf_setparams.c index ae4c937518..a33c35a942 100644 --- a/libavfilter/vf_setparams.c +++ b/libavfilter/vf_setparams.c @@ -23,6 +23,7 @@ #include "libavutil/pixfmt.h" #include "libavutil/opt.h" #include "avfilter.h" +#include "formats.h" #include "internal.h" #include "video.h" @@ -120,6 +121,29 @@ static const AVOption setparams_options[] = { AVFILTER_DEFINE_CLASS(setparams); +static int query_formats(AVFilterContext *ctx) +{ +SetParamsContext *s = ctx->priv; +AVFilterLink *outlink = ctx->outputs[0]; +int ret; + +if (s->colorspace >= 0) { +ret = ff_formats_ref(ff_make_formats_list_singleton(s->colorspace), + >incfg.color_spaces); +if (ret < 0) +return ret; +} + +if (s->color_range >= 0) { +ret = ff_formats_ref(ff_make_formats_list_singleton(s->color_range), + >incfg.color_ranges); +if (ret < 0) +return ret; +} + +return 0; +} + static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { AVFilterContext *ctx = inlink->dst; @@ -177,6 +201,7 @@ const AVFilter ff_vf_setparams = { .flags = AVFILTER_FLAG_METADATA_ONLY, FILTER_INPUTS(inputs), FILTER_OUTPUTS(ff_video_default_filterpad), +FILTER_QUERY_FUNC(query_formats), }; #if CONFIG_SETRANGE_FILTER @@ -217,6 +242,7 @@ const AVFilter ff_vf_setrange = { .flags = AVFILTER_FLAG_METADATA_ONLY, FILTER_INPUTS(inputs), FILTER_OUTPUTS(ff_video_default_filterpad), +FILTER_QUERY_FUNC(query_formats), }; #endif /* CONFIG_SETRANGE_FILTER */ -- 2.43.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] [PATCH v2 1/2] avcodec/vvc_mp4toannexb: check bytes left for nalu_len
On Fri, Feb 9, 2024 at 7:40 PM Andreas Rheinhardt < andreas.rheinha...@outlook.com> wrote: > Nuo Mi: > > Fixes: fuzzer timeout > > Fixes: > 65253/clusterfuzz-testcase-minimized-ffmpeg_BSF_VVC_MP4TOANNEXB_fuzzer-4972412487467008 > > > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > Signed-off-by: Andreas Rheinhardt > > --- > > libavcodec/bsf/vvc_mp4toannexb.c | 7 --- > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/libavcodec/bsf/vvc_mp4toannexb.c > b/libavcodec/bsf/vvc_mp4toannexb.c > > index 25c3726918..36bdae8f49 100644 > > --- a/libavcodec/bsf/vvc_mp4toannexb.c > > +++ b/libavcodec/bsf/vvc_mp4toannexb.c > > @@ -155,10 +155,11 @@ static int vvc_extradata_to_annexb(AVBSFContext > *ctx) > > } > > > > for (j = 0; j < cnt; j++) { > > -int nalu_len = bytestream2_get_be16(); > > +const int nalu_len = bytestream2_get_be16(); > > > > -if (4 + AV_INPUT_BUFFER_PADDING_SIZE + nalu_len > > > -SIZE_MAX - new_extradata_size) { > > +if (!nalu_len || > > +nalu_len > bytestream2_get_bytes_left() || > > +4 + AV_INPUT_BUFFER_PADDING_SIZE + nalu_len > SIZE_MAX > - new_extradata_size) { > > ret = AVERROR_INVALIDDATA; > > goto fail; > > } > > What about growing the packet? > Hi Andreas, Do you mean growing the packet only once for all nalus? However, this would change the original behavior and result in more duplicate code between the HEVC and VVC implementations. I can do it, but I'll refactor duplications to h2656_mp4toannexb.c first. Do you think that's okay? Thank you > - 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". > ___ 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 v2 2/2] avcodec/hevc_mp4toannexb: check bytes left for nalu_len
On Fri, Feb 9, 2024 at 7:47 PM Martin Storsjö wrote: > On Fri, 9 Feb 2024, Nuo Mi wrote: > > > similar issue as in the previous commit > > --- > > libavcodec/bsf/hevc_mp4toannexb.c | 6 -- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > Keep in mind, that while the patches are posted together, they can end up > at different places further in review, and in commits, so the commit > messages should ideally be understandable standalone. > Hi Martin Thank you for the reminder. Will do > > // Martin > > ___ 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/4] lavc/rv34dsp: R-V V rv34_inv_transform_dc
Happy new year, The gains are -unsurprisingly- modest here. Did you try to reorder instructions to improve scheduling? -- Rémi Denis-Courmont http://www.remlab.net/ ___ 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/7] lavc/me_cmp: R-V V pix_abs
Le lauantaina 10. helmikuuta 2024, 11.14.11 EET Rémi Denis-Courmont a écrit : > But your patchset seems to leave those out anyway. Nevermind that bit, I missed other mails -- レミ・デニ-クールモン http://www.remlab.net/ ___ 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/7] lavc/me_cmp: R-V V pix_abs
Le perjantaina 9. helmikuuta 2024, 17.34.40 EET flow gg a écrit : > The issue here is that any load greater than e8 will fail the test(Bus > error), so it cannot use vlse64 or similar methods... AFAICT, data is aligned on 16 bytes here, so using larger element sizes should not be a problem. That being the case, you can load pretty much any power-of- two byte quantity per row up to 512 bits, as 8 segments of 64-bit elements. That is more than enough to deal with 16-byte rows. Of course, that results in a tiled data layout, so it only works if individual elements are all treated equally with no cross-row calculations. This might require trickery or not work at all for those functions that subtract adjacent values. But your patchset seems to leave those out anyway. -- Rémi Denis-Courmont http://www.remlab.net/ ___ 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 v3] lavc/libvpxenc: add screen-content-mode option
Hello. On Fri, Feb 9, 2024 at 7:28 PM James Zern wrote: > Just sent v4, which addresses the below comments. Thank you. > On Thu, Feb 8, 2024 at 1:58 PM Dariusz Marcinkiewicz via ffmpeg-devel > wrote: ... > > --- a/libavcodec/libvpxenc.c > > +++ b/libavcodec/libvpxenc.c > > @@ -114,6 +114,7 @@ typedef struct VPxEncoderContext { > > int crf; > > int static_thresh; > > int max_intra_rate; > > +int screen_content_mode; > > Move this to a VP8-only section similar to VP9. > Done. ... > > @@ -164,6 +165,7 @@ static const char *const ctlidstr[] = { ... > > +#ifdef VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE > > This control was available in libvpx 1.4.0, the minimum version > supported. You can remove this check. > Done. ... > > +if (avctx->codec_id == AV_CODEC_ID_VP8 && ctx->screen_content_mode >= > > 0) { > > + if (ctx->screen_content_mode == 2 && ctx->is_alpha) { > > Indent is 4 spaces here and throughout the patch. > Done. > > [...] > > > > -coded_size = queue_frames(avctx, >encoder, > > >coded_frame_list, pkt); > > +coded_size = queue_frames(avctx, >encoder, >coded_frame_list, > > + pkt, ctx->is_alpha, _enc); > > +if (avctx->codec_id == AV_CODEC_ID_VP8 && frame_enc == 0 && > > +ctx->screen_content_mode == 2 && frame) { > > +// VP8 tuned for screen content with aggresive rate control - > > returned > > aggressive. > > > +// OK status code but produced no output, this indicates frame was > > +// rolled back due to bitrate overshoot - try to encode it again. > > This is a little weird given there's no adjustment to the encoder. I > think this should be a separate patch at least. If the encoder decided > to drop the frame in this mode it seems like the right decision given > the setting description. If it works as part of the drop frames > threshold then maybe the recode should be in the library based on some > threshold. > Dropped this part. ... > > [...] > > @@ -1946,6 +1987,12 @@ static const AVOption vp8_options[] = { > > { "auto-alt-ref","Enable use of alternate reference " > > "frames (2-pass only)", > > OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, VE}, > > { "cpu-used","Quality/Speed ratio modifier", > > OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1}, -16, 16, VE}, > > +#ifdef VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE > > +{ "screen-content-mode", "Encoder screen content mode", > > OFFSET(screen_content_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, VE, > > "screen_content_mode"}, > > +{ "off", "Screen content mode off",0, > > AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, VE, > > "screen_content_mode"}, > > +{ "on", "Screen content mode on", 0, > > AV_OPT_TYPE_CONST, {.i64 = 1}, 0, 0, VE, > > "screen_content_mode"}, > > +{ "on-agressive-rate-control", "Screen content mode on with aggressive > > rate control", 0,AV_OPT_TYPE_CONST, {.i64 = 2}, 0, 0, VE, > > "screen_content_mode"}, > > aggressive. > There's no string equivalent in vpxenc though, so this should probably > just be ints. > Removed. ... > > diff --git a/libavcodec/version.h b/libavcodec/version.h > > index 0fae3d06d3..4b618d740f 100644 > > --- a/libavcodec/version.h > > +++ b/libavcodec/version.h > > @@ -30,7 +30,7 @@ > > #include "version_major.h" > > > > #define LIBAVCODEC_VERSION_MINOR 38 > > -#define LIBAVCODEC_VERSION_MICRO 100 > > +#define LIBAVCODEC_VERSION_MICRO 101 > > > > This will need a rebase. Done. ___ 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] lavc/libvpxenc: add screen-content-mode option
This exposes VP8E_SET_SCREEN_CONTENT_MODE option from libvpx. Co-authored-by: Erik Språng Signed-off-by: Dariusz Marcinkiewicz --- doc/encoders.texi | 3 +++ libavcodec/libvpxenc.c | 11 +++ libavcodec/version.h | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index c9fe6d6143..0868aa66db 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -2150,6 +2150,9 @@ of quality. Set a change threshold on blocks below which they will be skipped by the encoder. +@item screen-content-mode +Screen content mode, one of: off (0), screen (1), screen with more aggressive rate control (2). + @item slices (@emph{token-parts}) Note that FFmpeg's @option{slices} option gives the total number of partitions, while @command{vpxenc}'s @option{token-parts} is given as diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 80988a2608..0d507beaae 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -102,6 +102,7 @@ typedef struct VPxEncoderContext { #define VP8F_AUTO_ALT_REF0x0002 ///< Enable automatic alternate reference frame generation int auto_alt_ref; +int screen_content_mode; int arnr_max_frames; int arnr_strength; @@ -164,6 +165,7 @@ static const char *const ctlidstr[] = { [VP8E_SET_MAX_INTRA_BITRATE_PCT] = "VP8E_SET_MAX_INTRA_BITRATE_PCT", [VP8E_SET_SHARPNESS] = "VP8E_SET_SHARPNESS", [VP8E_SET_TEMPORAL_LAYER_ID] = "VP8E_SET_TEMPORAL_LAYER_ID", +[VP8E_SET_SCREEN_CONTENT_MODE] = "VP8E_SET_SCREEN_CONTENT_MODE", #if CONFIG_LIBVPX_VP9_ENCODER [VP9E_SET_LOSSLESS]= "VP9E_SET_LOSSLESS", [VP9E_SET_TILE_COLUMNS]= "VP9E_SET_TILE_COLUMNS", @@ -1262,6 +1264,14 @@ static av_cold int vpx_init(AVCodecContext *avctx, #endif } #endif +if (avctx->codec_id == AV_CODEC_ID_VP8 && ctx->screen_content_mode >= 0) { +if (ctx->screen_content_mode == 2 && ctx->is_alpha) { +av_log(avctx, AV_LOG_ERROR, + "Transparency encoding with screen mode with aggressive rate control not supported\n"); +return AVERROR(EINVAL); +} +codecctl_int(avctx, VP8E_SET_SCREEN_CONTENT_MODE, ctx->screen_content_mode); +} av_log(avctx, AV_LOG_DEBUG, "Using deadline: %d\n", ctx->deadline); @@ -1946,6 +1956,7 @@ static const AVOption vp8_options[] = { { "auto-alt-ref","Enable use of alternate reference " "frames (2-pass only)", OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, VE}, { "cpu-used","Quality/Speed ratio modifier", OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1}, -16, 16, VE}, +{ "screen-content-mode", "Encoder screen content mode", OFFSET(screen_content_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, VE, "screen_content_mode"}, LEGACY_OPTIONS { NULL } }; diff --git a/libavcodec/version.h b/libavcodec/version.h index f2f14eaed1..ecdbc51c74 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -30,7 +30,7 @@ #include "version_major.h" #define LIBAVCODEC_VERSION_MINOR 39 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ -- 2.43.0.687.g38aa6559b0-goog ___ 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".