Re: [FFmpeg-devel] [PATCH] avfilter: split negate filter from lut filter
Will apply promptly. ___ 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] swscale/x86/output.asm: add x86-optimized planer gbr yuv2anyX functions
On Monday, October 25, 2021, Michael Niedermayer wrote: > On Sun, Oct 24, 2021 at 09:09:52PM -0700, mindm...@gmail.com wrote: > > From: Mark Reid > > > > yuv2gbrp_full_X_4_512_c: 12096.6 > > yuv2gbrp_full_X_4_512_sse2: 10782.6 > > yuv2gbrp_full_X_4_512_sse4: 5143.6 > > yuv2gbrp_full_X_4_512_avx2: 3000.1 > > yuv2gbrap_full_X_4_512_c: 15463.1 > > yuv2gbrap_full_X_4_512_sse2: 14296.6 > > yuv2gbrap_full_X_4_512_sse4: 6319.1 > > yuv2gbrap_full_X_4_512_avx2: 3554.1 > > yuv2gbrp9be_full_X_4_512_c: 14281.6 > > yuv2gbrp9be_full_X_4_512_sse2: 11206.1 > > yuv2gbrp9be_full_X_4_512_sse4: 5033.6 > > yuv2gbrp9be_full_X_4_512_avx2: 3012.6 > > yuv2gbrp9le_full_X_4_512_c: 12688.6 > > yuv2gbrp9le_full_X_4_512_sse2: 10914.1 > > yuv2gbrp9le_full_X_4_512_sse4: 5144.6 > > yuv2gbrp9le_full_X_4_512_avx2: 3014.6 > > yuv2gbrp10be_full_X_4_512_c: 14257.6 > > yuv2gbrp10be_full_X_4_512_sse2: 11089.6 > > yuv2gbrp10be_full_X_4_512_sse4: 5039.1 > > yuv2gbrp10be_full_X_4_512_avx2: 3001.1 > > yuv2gbrp10le_full_X_4_512_c: 12098.6 > > yuv2gbrp10le_full_X_4_512_sse2: 10884.1 > > yuv2gbrp10le_full_X_4_512_sse4: 5138.1 > > yuv2gbrp10le_full_X_4_512_avx2: 2999.6 > > yuv2gbrap10be_full_X_4_512_c: 18549.6 > > yuv2gbrap10be_full_X_4_512_sse2: 14538.6 > > yuv2gbrap10be_full_X_4_512_sse4: 6292.6 > > yuv2gbrap10be_full_X_4_512_avx2: 3583.6 > > yuv2gbrap10le_full_X_4_512_c: 16631.1 > > yuv2gbrap10le_full_X_4_512_sse2: 14190.6 > > yuv2gbrap10le_full_X_4_512_sse4: 6348.1 > > yuv2gbrap10le_full_X_4_512_avx2: 3554.6 > > yuv2gbrp12be_full_X_4_512_c: 13555.1 > > yuv2gbrp12be_full_X_4_512_sse2: 10952.1 > > yuv2gbrp12be_full_X_4_512_sse4: 5137.6 > > yuv2gbrp12be_full_X_4_512_avx2: 3009.6 > > yuv2gbrp12le_full_X_4_512_c: 12082.6 > > yuv2gbrp12le_full_X_4_512_sse2: 10891.1 > > yuv2gbrp12le_full_X_4_512_sse4: 5184.1 > > yuv2gbrp12le_full_X_4_512_avx2: 3011.1 > > yuv2gbrap12be_full_X_4_512_c: 18689.6 > > yuv2gbrap12be_full_X_4_512_sse2: 14522.6 > > yuv2gbrap12be_full_X_4_512_sse4: 6237.6 > > yuv2gbrap12be_full_X_4_512_avx2: 3585.6 > > yuv2gbrap12le_full_X_4_512_c: 16760.6 > > yuv2gbrap12le_full_X_4_512_sse2: 14202.1 > > yuv2gbrap12le_full_X_4_512_sse4: 6252.1 > > yuv2gbrap12le_full_X_4_512_avx2: 3591.1 > > yuv2gbrp14be_full_X_4_512_c: 13555.6 > > yuv2gbrp14be_full_X_4_512_sse2: 10949.1 > > yuv2gbrp14be_full_X_4_512_sse4: 5185.1 > > yuv2gbrp14be_full_X_4_512_avx2: 3012.1 > > yuv2gbrp14le_full_X_4_512_c: 12068.1 > > yuv2gbrp14le_full_X_4_512_sse2: 10883.6 > > yuv2gbrp14le_full_X_4_512_sse4: 5145.1 > > yuv2gbrp14le_full_X_4_512_avx2: 3007.1 > > yuv2gbrp16be_full_X_4_512_c: 12383.6 > > yuv2gbrp16be_full_X_4_512_sse2: 8230.6 > > yuv2gbrp16be_full_X_4_512_sse4: 4765.6 > > yuv2gbrp16be_full_X_4_512_avx2: 2742.6 > > yuv2gbrp16le_full_X_4_512_c: 10906.1 > > yuv2gbrp16le_full_X_4_512_sse2: 28732.1 > > yuv2gbrp16le_full_X_4_512_sse4: 4709.6 > > yuv2gbrp16le_full_X_4_512_avx2: 2753.1 > > yuv2gbrap16be_full_X_4_512_c: 15472.6 > > yuv2gbrap16be_full_X_4_512_sse2: 11021.6 > > yuv2gbrap16be_full_X_4_512_sse4: 5487.6 > > yuv2gbrap16be_full_X_4_512_avx2: 3143.6 > > yuv2gbrap16le_full_X_4_512_c: 13668.6 > > yuv2gbrap16le_full_X_4_512_sse2: 10562.1 > > yuv2gbrap16le_full_X_4_512_sse4: 5506.6 > > yuv2gbrap16le_full_X_4_512_avx2: 3149.6 > > yuv2gbrpf32be_full_X_4_512_c: 15471.1 > > yuv2gbrpf32be_full_X_4_512_sse2: 8524.6 > > yuv2gbrpf32be_full_X_4_512_sse4: 4559.1 > > yuv2gbrpf32be_full_X_4_512_avx2: 2388.1 > > yuv2gbrpf32le_full_X_4_512_c: 14247.6 > > yuv2gbrpf32le_full_X_4_512_sse2: 7600.6 > > yuv2gbrpf32le_full_X_4_512_sse4: 4385.6 > > yuv2gbrpf32le_full_X_4_512_avx2: 2258.6 > > yuv2gbrapf32be_full_X_4_512_c: 18412.1 > > yuv2gbrapf32be_full_X_4_512_sse2: 11353.6 > > yuv2gbrapf32be_full_X_4_512_sse4: 5807.1 > > yuv2gbrapf32be_full_X_4_512_avx2: 2928.1 > > yuv2gbrapf32le_full_X_4_512_c: 16485.1 > > yuv2gbrapf32le_full_X_4_512_sse2: 10202.1 > > yuv2gbrapf32le_full_X_4_512_sse4: 5571.6 > > yuv2gbrapf32le_full_X_4_512_avx2: 2847.6 > > > > > > --- > > libswscale/x86/output.asm | 440 +- > > libswscale/x86/swscale.c | 99 + > > tests/checkasm/Makefile | 2 +- > > tests/checkasm/checkasm.c | 1 + > > tests/checkasm/checkasm.h | 1 + > > tests/checkasm/sw_gbrp.c | 198 + > > tests/fate/checkasm.mak | 1 + > > 7 files changed, 740 insertions(+), 2 deletions(-) > > create mode 100644 tests/checkasm/sw_gbrp.c > > seems to work > asm review left to people who worked with asm more recently than me > > Thanks for taking the time to test, I was planning on doing the planer input ones next and add the missing unscaled floating point rgb2rgb functions > also if you or anyone wants a random idea for swscale improvments > we are missing a direct yuv->yuv converter converting between different > yuv colorspaces, atm these are handled with rgb intermediate > > Like what the vf_colormatrix filter does? > thx > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > If you fake or manipula
Re: [FFmpeg-devel] [PATCH 3/5] avformat/imf: Demuxer implementation
On Fri, Oct 8, 2021 at 1:42 AM wrote: > From: Pierre-Anthony Lemieux > > Signed-off-by: Pierre-Anthony Lemieux > --- > > Notes: > Implements the IMF demuxer. > > libavformat/imfdec.c | 660 +++ > 1 file changed, 660 insertions(+) > create mode 100644 libavformat/imfdec.c > > diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c > new file mode 100644 > index 00..0c64fe0c03 > --- /dev/null > +++ b/libavformat/imfdec.c > @@ -0,0 +1,660 @@ > +/* > + * Copyright (c) Sandflow Consulting LLC > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > met: > + * > + * * Redistributions of source code must retain the above copyright > notice, this > + * list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > notice, > + * this list of conditions and the following disclaimer in the > documentation > + * and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > "AS IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS > BE > + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > THE > + * POSSIBILITY OF SUCH DAMAGE. > + * > + * 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 > + */ > + > +/** > + * Demuxes an IMF Composition > + * > + * References > + * OV 2067-0:2018 - SMPTE Overview Document - Interoperable Master Format > + * ST 2067-2:2020 - SMPTE Standard - Interoperable Master Format — Core > Constraints > + * ST 2067-3:2020 - SMPTE Standard - Interoperable Master Format — > Composition Playlist > + * ST 2067-5:2020 - SMPTE Standard - Interoperable Master Format — > Essence Component > + * ST 2067-20:2016 - SMPTE Standard - Interoperable Master Format — > Application #2 > + * ST 2067-21:2020 - SMPTE Standard - Interoperable Master Format — > Application #2 Extended > + * ST 2067-102:2017 - SMPTE Standard - Interoperable Master Format — > Common Image Pixel Color Schemes > + * ST 429-9:2007 - SMPTE Standard - D-Cinema Packaging — Asset Mapping > and File Segmentation > + * > + * @author Marc-Antoine Arnaud > + * @author Valentin Noel > + * @file > + * @ingroup lavu_imf > + */ > + > +#include "imf.h" > +#include "imf_internal.h" > +#include "internal.h" > +#include "libavutil/opt.h" > +#include "libavutil/bprint.h" > +#include "libavutil/avstring.h" > +#include "mxf.h" > +#include "url.h" > +#include > +#include > + > +#define MAX_BPRINT_READ_SIZE (UINT_MAX - 1) > +#define DEFAULT_ASSETMAP_SIZE 8 * 1024 > + > +typedef struct IMFVirtualTrackResourcePlaybackCtx { > +IMFAssetLocator *locator; > +IMFTrackFileResource *resource; > +AVFormatContext *ctx; > +} IMFVirtualTrackResourcePlaybackCtx; > + > +typedef struct IMFVirtualTrackPlaybackCtx { > +// Track index in playlist > +int32_t index; > +// Time counters > +AVRational current_timestamp; > +AVRational duration; > +// Resources > +unsigned int resource_count; > +IMFVirtualTrackResourcePlaybackCtx **resources; > +// Decoding cursors > +uint32_t current_resource_index; > +int64_t last_pts; > +} IMFVirtualTrackPlaybackCtx; > + > +typedef struct IMFContext { > +const AVClass *class; > +const char *base_url; > +char *asset_map_paths; > +AVIOInterruptCB *interrupt_callback; > +AVDictionary *avio_opts; > +IMFCPL *cpl; > +IMFAssetLocatorMap *asset_locator_map; > +unsigned int track_count; > +IMFVirtualTrackPlaybackCtx **tracks; > +} IMFContext; > +
Re: [FFmpeg-devel] [PATCH 5/5] avformat/imf: Build system
Build stuff additions should not really belong in own patch. ___ 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/5] avformat/imf: CPL processor
On Wed, Oct 20, 2021 at 4:55 PM wrote: > From: Pierre-Anthony Lemieux > > Signed-off-by: Pierre-Anthony Lemieux > --- > > Notes: > Implements IMF Composition Playlist (CPL) parsing. > > libavformat/imf_cpl.c | 666 ++ > 1 file changed, 666 insertions(+) > create mode 100644 libavformat/imf_cpl.c > > diff --git a/libavformat/imf_cpl.c b/libavformat/imf_cpl.c > new file mode 100644 > index 00..8ef574ad78 > --- /dev/null > +++ b/libavformat/imf_cpl.c > @@ -0,0 +1,666 @@ > +/* > + * Copyright (c) Sandflow Consulting LLC > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > met: > + * > + * * Redistributions of source code must retain the above copyright > notice, this > + * list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > notice, > + * this list of conditions and the following disclaimer in the > documentation > + * and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > "AS IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS > BE > + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > THE > + * POSSIBILITY OF SUCH DAMAGE. > + * > + * 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 > + */ > + > +/** > + * Implements IMP CPL processing > + * > + * @author Pierre-Anthony Lemieux > + * @file > + * @ingroup lavu_imf > + */ > + > +#include "imf.h" > +#include "imf_internal.h" > +#include "libavformat/mxf.h" > +#include "libavutil/bprint.h" > +#include "libavutil/error.h" > +#include > + > +xmlNodePtr xml_get_child_element_by_name(xmlNodePtr parent, const char > *name_utf8) { > +xmlNodePtr cur_element; > + > +cur_element = xmlFirstElementChild(parent); > +while (cur_element) { > +if (xmlStrcmp(cur_element->name, name_utf8) == 0) > +return cur_element; > +cur_element = xmlNextElementSibling(cur_element); > +} > +return NULL; > +} > + > +int xml_read_UUID(xmlNodePtr element, uint8_t uuid[16]) { > +xmlChar *element_text = NULL; > +int scanf_ret; > +int ret = 0; > + > +element_text = xmlNodeListGetString(element->doc, > element->xmlChildrenNode, 1); > +scanf_ret = sscanf(element_text, > +UUID_FORMAT, > +&uuid[0], > +&uuid[1], > +&uuid[2], > +&uuid[3], > +&uuid[4], > +&uuid[5], > +&uuid[6], > +&uuid[7], > +&uuid[8], > +&uuid[9], > +&uuid[10], > +&uuid[11], > +&uuid[12], > +&uuid[13], > +&uuid[14], > +&uuid[15]); > +if (scanf_ret != 16) { > +av_log(NULL, AV_LOG_ERROR, "Invalid UUID\n"); > +ret = AVERROR_INVALIDDATA; > +} > +xmlFree(element_text); > + > +return ret; > +} > + > +int xml_read_rational(xmlNodePtr element, AVRational *rational) { > +xmlChar *element_text = NULL; > +int ret = 0; > + > +element_text = xmlNodeListGetString(element->doc, > element->xmlChildrenNode, 1); > +if (sscanf(element_text, "%i %i", &rational->num, &rational->den) != > 2) { > +av_log(NULL, AV_LOG_ERROR, "Invalid rational number\n"); > +ret = AVERROR_INVALIDDATA; > +} > +xmlFree(element_text); > + > +return ret; > +} > + > +int xml_read_ulong(xmlNodePtr element, unsigned long *number) { > +xmlChar *element_text = NULL; > +int ret = 0; > + > +element_text = xmlNodeListGetString(element->doc, > element->xmlChildr
Re: [FFmpeg-devel] [PATCH] swscale/x86/output.asm: add x86-optimized planer gbr yuv2anyX functions
On Wed, Oct 27, 2021 at 9:51 AM Mark Reid wrote: > On Monday, October 25, 2021, Michael Niedermayer > wrote: > > > On Sun, Oct 24, 2021 at 09:09:52PM -0700, mindm...@gmail.com wrote: > > > From: Mark Reid > > > > > > yuv2gbrp_full_X_4_512_c: 12096.6 > > > yuv2gbrp_full_X_4_512_sse2: 10782.6 > > > yuv2gbrp_full_X_4_512_sse4: 5143.6 > > > yuv2gbrp_full_X_4_512_avx2: 3000.1 > > > yuv2gbrap_full_X_4_512_c: 15463.1 > > > yuv2gbrap_full_X_4_512_sse2: 14296.6 > > > yuv2gbrap_full_X_4_512_sse4: 6319.1 > > > yuv2gbrap_full_X_4_512_avx2: 3554.1 > > > yuv2gbrp9be_full_X_4_512_c: 14281.6 > > > yuv2gbrp9be_full_X_4_512_sse2: 11206.1 > > > yuv2gbrp9be_full_X_4_512_sse4: 5033.6 > > > yuv2gbrp9be_full_X_4_512_avx2: 3012.6 > > > yuv2gbrp9le_full_X_4_512_c: 12688.6 > > > yuv2gbrp9le_full_X_4_512_sse2: 10914.1 > > > yuv2gbrp9le_full_X_4_512_sse4: 5144.6 > > > yuv2gbrp9le_full_X_4_512_avx2: 3014.6 > > > yuv2gbrp10be_full_X_4_512_c: 14257.6 > > > yuv2gbrp10be_full_X_4_512_sse2: 11089.6 > > > yuv2gbrp10be_full_X_4_512_sse4: 5039.1 > > > yuv2gbrp10be_full_X_4_512_avx2: 3001.1 > > > yuv2gbrp10le_full_X_4_512_c: 12098.6 > > > yuv2gbrp10le_full_X_4_512_sse2: 10884.1 > > > yuv2gbrp10le_full_X_4_512_sse4: 5138.1 > > > yuv2gbrp10le_full_X_4_512_avx2: 2999.6 > > > yuv2gbrap10be_full_X_4_512_c: 18549.6 > > > yuv2gbrap10be_full_X_4_512_sse2: 14538.6 > > > yuv2gbrap10be_full_X_4_512_sse4: 6292.6 > > > yuv2gbrap10be_full_X_4_512_avx2: 3583.6 > > > yuv2gbrap10le_full_X_4_512_c: 16631.1 > > > yuv2gbrap10le_full_X_4_512_sse2: 14190.6 > > > yuv2gbrap10le_full_X_4_512_sse4: 6348.1 > > > yuv2gbrap10le_full_X_4_512_avx2: 3554.6 > > > yuv2gbrp12be_full_X_4_512_c: 13555.1 > > > yuv2gbrp12be_full_X_4_512_sse2: 10952.1 > > > yuv2gbrp12be_full_X_4_512_sse4: 5137.6 > > > yuv2gbrp12be_full_X_4_512_avx2: 3009.6 > > > yuv2gbrp12le_full_X_4_512_c: 12082.6 > > > yuv2gbrp12le_full_X_4_512_sse2: 10891.1 > > > yuv2gbrp12le_full_X_4_512_sse4: 5184.1 > > > yuv2gbrp12le_full_X_4_512_avx2: 3011.1 > > > yuv2gbrap12be_full_X_4_512_c: 18689.6 > > > yuv2gbrap12be_full_X_4_512_sse2: 14522.6 > > > yuv2gbrap12be_full_X_4_512_sse4: 6237.6 > > > yuv2gbrap12be_full_X_4_512_avx2: 3585.6 > > > yuv2gbrap12le_full_X_4_512_c: 16760.6 > > > yuv2gbrap12le_full_X_4_512_sse2: 14202.1 > > > yuv2gbrap12le_full_X_4_512_sse4: 6252.1 > > > yuv2gbrap12le_full_X_4_512_avx2: 3591.1 > > > yuv2gbrp14be_full_X_4_512_c: 13555.6 > > > yuv2gbrp14be_full_X_4_512_sse2: 10949.1 > > > yuv2gbrp14be_full_X_4_512_sse4: 5185.1 > > > yuv2gbrp14be_full_X_4_512_avx2: 3012.1 > > > yuv2gbrp14le_full_X_4_512_c: 12068.1 > > > yuv2gbrp14le_full_X_4_512_sse2: 10883.6 > > > yuv2gbrp14le_full_X_4_512_sse4: 5145.1 > > > yuv2gbrp14le_full_X_4_512_avx2: 3007.1 > > > yuv2gbrp16be_full_X_4_512_c: 12383.6 > > > yuv2gbrp16be_full_X_4_512_sse2: 8230.6 > > > yuv2gbrp16be_full_X_4_512_sse4: 4765.6 > > > yuv2gbrp16be_full_X_4_512_avx2: 2742.6 > > > yuv2gbrp16le_full_X_4_512_c: 10906.1 > > > yuv2gbrp16le_full_X_4_512_sse2: 28732.1 > > > yuv2gbrp16le_full_X_4_512_sse4: 4709.6 > > > yuv2gbrp16le_full_X_4_512_avx2: 2753.1 > > > yuv2gbrap16be_full_X_4_512_c: 15472.6 > > > yuv2gbrap16be_full_X_4_512_sse2: 11021.6 > > > yuv2gbrap16be_full_X_4_512_sse4: 5487.6 > > > yuv2gbrap16be_full_X_4_512_avx2: 3143.6 > > > yuv2gbrap16le_full_X_4_512_c: 13668.6 > > > yuv2gbrap16le_full_X_4_512_sse2: 10562.1 > > > yuv2gbrap16le_full_X_4_512_sse4: 5506.6 > > > yuv2gbrap16le_full_X_4_512_avx2: 3149.6 > > > yuv2gbrpf32be_full_X_4_512_c: 15471.1 > > > yuv2gbrpf32be_full_X_4_512_sse2: 8524.6 > > > yuv2gbrpf32be_full_X_4_512_sse4: 4559.1 > > > yuv2gbrpf32be_full_X_4_512_avx2: 2388.1 > > > yuv2gbrpf32le_full_X_4_512_c: 14247.6 > > > yuv2gbrpf32le_full_X_4_512_sse2: 7600.6 > > > yuv2gbrpf32le_full_X_4_512_sse4: 4385.6 > > > yuv2gbrpf32le_full_X_4_512_avx2: 2258.6 > > > yuv2gbrapf32be_full_X_4_512_c: 18412.1 > > > yuv2gbrapf32be_full_X_4_512_sse2: 11353.6 > > > yuv2gbrapf32be_full_X_4_512_sse4: 5807.1 > > > yuv2gbrapf32be_full_X_4_512_avx2: 2928.1 > > > yuv2gbrapf32le_full_X_4_512_c: 16485.1 > > > yuv2gbrapf32le_full_X_4_512_sse2: 10202.1 > > > yuv2gbrapf32le_full_X_4_512_sse4: 5571.6 > > > yuv2gbrapf32le_full_X_4_512_avx2: 2847.6 > > > > > > > > > --- > > > libswscale/x86/output.asm | 440 +- > > > libswscale/x86/swscale.c | 99 + > > > tests/checkasm/Makefile | 2 +- > > > tests/checkasm/checkasm.c | 1 + > > > tests/checkasm/checkasm.h | 1 + > > > tests/checkasm/sw_gbrp.c | 198 + > > > tests/fate/checkasm.mak | 1 + > > > 7 files changed, 740 insertions(+), 2 deletions(-) > > > create mode 100644 tests/checkasm/sw_gbrp.c > > > > seems to work > > asm review left to people who worked with asm more recently than me > > > > > Thanks for taking the time to test, I was planning on doing the planer > input ones next and add the missing unscaled floating point rgb2rgb > functions > > > > also if you or anyone wants a random idea for swscale improvments > > we are missing a direc
Re: [FFmpeg-devel] [PATCH 7/8] avformat/mpegts: Fix for the DOVI video stream descriptor
On Thu, Oct 14, 2021 at 5:31 PM wrote: > > On Thu, Oct 14, 2021 at 10:12:05AM -0400, quietvoid wrote: > > On Thu, Oct 14, 2021 at 9:52 AM wrote: > > > > > On Thu, Oct 14, 2021 at 09:45:45AM -0400, quietvoid wrote: > > > > On Thu, Oct 14, 2021 at 9:36 AM wrote: > > > > > > > > > On Thu, Oct 14, 2021 at 09:18:16AM -0400, f tcChlisop0 wrote: > > > > > > On Thu, Oct 14, 2021 at 9:10 AM wrote: > > > > > > > > > > > > > From: Limin Wang > > > > > > > > > > > > > > By < > > > > > > Format > > > > > v1.2>> > > > > > > > > > > > > > > Signed-off-by: Limin Wang > > > > > > > --- > > > > > > > libavformat/mpegts.c | 11 +-- > > > > > > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c > > > > > > > index 44d9298..774964d 100644 > > > > > > > --- a/libavformat/mpegts.c > > > > > > > +++ b/libavformat/mpegts.c > > > > > > > @@ -2178,6 +2178,8 @@ int > > > > > > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > *fc, > > > > > > > AVStream *st, int stream_type > > > > > > > AVDOVIDecoderConfigurationRecord *dovi; > > > > > > > size_t dovi_size; > > > > > > > int ret; > > > > > > > +int dependency_pid; > > > > > > > + > > > > > > > if (desc_end - *pp < 4) // (8 + 8 + 7 + 6 + 1 + 1 + > > > 1) / 8 > > > > > > > return AVERROR_INVALIDDATA; > > > > > > > > > > > > > > @@ -2193,7 +2195,11 @@ int > > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > *fc, > > > > > > > AVStream *st, int stream_type > > > > > > > dovi->rpu_present_flag = (buf >> 2) & 0x01;// 1 > > > bit > > > > > > > dovi->el_present_flag = (buf >> 1) & 0x01;// 1 > > > bit > > > > > > > dovi->bl_present_flag = buf & 0x01;// 1 > > > bit > > > > > > > -if (desc_end - *pp >= 20) { // 4 + 4 * 4 > > > > > > > +if (!dovi->bl_present_flag && desc_end - *pp >= 2) { > > > > > > > +buf = get16(pp, desc_end); > > > > > > > +dependency_pid = buf >> 3; // 13 bits > > > > > > > +} > > > > > > > +if (desc_end - *pp >= 1) { // 8 bits > > > > > > > buf = get8(pp, desc_end); > > > > > > > dovi->dv_bl_signal_compatibility_id = (buf >> 4) > > > > > > > & > > > > > 0x0f; > > > > > > > // 4 bits > > > > > > > } else { > > > > > > > @@ -2210,12 +2216,13 @@ int > > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > *fc, > > > > > > > AVStream *st, int stream_type > > > > > > > } > > > > > > > > > > > > > > av_log(fc, AV_LOG_TRACE, "DOVI, version: %d.%d, > > > profile: > > > > > %d, > > > > > > > level: %d, " > > > > > > > - "rpu flag: %d, el flag: %d, bl flag: %d, > > > > > compatibility > > > > > > > id: %d\n", > > > > > > > + "rpu flag: %d, el flag: %d, bl flag: %d, > > > > > > > dependency_pid: %d, compatibility id: %d\n", > > > > > > > dovi->dv_version_major, > > > > > > > dovi->dv_version_minor, > > > > > > > dovi->dv_profile, dovi->dv_level, > > > > > > > dovi->rpu_present_flag, > > > > > > > dovi->el_present_flag, > > > > > > > dovi->bl_present_flag, > > > > > > > + dependency_pid, > > > > > > > dovi->dv_bl_signal_compatibility_id); > > > > > > > } > > > > > > > break; > > > > > > > -- > > > > > > > 1.8.3.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". > > > > > > > > > > > > > > > > > > > Hi, this is something I had fixed in this patchset: > > > > > > https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/286234.html > > > > > > However the dependency_pid is ignored, as it has no use presently. > > > > > > > > > > > > Which patch should take precedence? > > > > > > > > > > Sorry, I have noticed your patch before. By the quick review of your > > > patch, > > > > > it's a lot function change and difficult to merge I think. I prefer to > > > > > fix the issue with existing code first instead of mixed function > > > change. > > > > > > > > > > > > > Okay, that makes sense. > > > > I will wait and rebase before resending for review then. > > > > > > > > However I'm worried my patch will still result in ignoring > > > dependency_pid, > > > > because it is not part of AVDOVIDecoderConfigurationRecord, unless it is > > > > added. > > > > > > I failed to find your patchset in my email archive, so I reply it here for > > > my comments: > > > -if (ret < 0) { > > > -
[FFmpeg-devel] [PATCH 1/3] libavcodec/vaapi_encode: Change the way to call async to increase performance
Fix: #7706. After commit 5fdcf85bbffe7451c2, vaapi encoder's performance decrease. The reason is that vaRenderPicture() and vaSyncSurface() are called at the same time (vaRenderPicture() always followed by a vaSyncSurface()). When we encode stream with B frames, we need buffer to reorder frames, so we can send serveral frames to HW at once to increase performance. Now I changed them to be called in a asynchronous way, which will make better use of hardware. 1080p transcoding increases about 17% fps on my environment. Signed-off-by: Wenbin Chen --- libavcodec/vaapi_encode.c | 41 --- libavcodec/vaapi_encode.h | 3 +++ 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index ec054ae701..5927849233 100644 --- a/libavcodec/vaapi_encode.c +++ b/libavcodec/vaapi_encode.c @@ -951,8 +951,10 @@ static int vaapi_encode_pick_next(AVCodecContext *avctx, if (!pic && ctx->end_of_stream) { --b_counter; pic = ctx->pic_end; -if (pic->encode_issued) +if (pic->encode_complete) return AVERROR_EOF; +else if (pic->encode_issued) +return AVERROR(EAGAIN); } if (!pic) { @@ -1177,20 +1179,31 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) return AVERROR(EAGAIN); } -pic = NULL; -err = vaapi_encode_pick_next(avctx, &pic); -if (err < 0) -return err; -av_assert0(pic); +while (av_fifo_size(ctx->encode_fifo) <= MAX_PICTURE_REFERENCES * sizeof(VAAPIEncodePicture *)) { +pic = NULL; +err = vaapi_encode_pick_next(avctx, &pic); +if (err < 0) +break; +av_assert0(pic); -pic->encode_order = ctx->encode_order++; +pic->encode_order = ctx->encode_order + +(av_fifo_size(ctx->encode_fifo) / sizeof(VAAPIEncodePicture *)); -err = vaapi_encode_issue(avctx, pic); -if (err < 0) { -av_log(avctx, AV_LOG_ERROR, "Encode failed: %d.\n", err); -return err; +err = vaapi_encode_issue(avctx, pic); +if (err < 0) { +av_log(avctx, AV_LOG_ERROR, "Encode failed: %d.\n", err); +return err; +} + +av_fifo_generic_write(ctx->encode_fifo, &pic, sizeof(pic), NULL); } +if (!av_fifo_size(ctx->encode_fifo)) +return err; + +av_fifo_generic_read(ctx->encode_fifo, &pic, sizeof(pic), NULL); +ctx->encode_order = pic->encode_order + 1; + err = vaapi_encode_output(avctx, pic, pkt); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Output failed: %d.\n", err); @@ -2520,6 +2533,11 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) } } +ctx->encode_fifo = av_fifo_alloc((MAX_PICTURE_REFERENCES + 1) * + sizeof(VAAPIEncodePicture *)); +if (!ctx->encode_fifo) +return AVERROR(ENOMEM); + return 0; fail: @@ -2552,6 +2570,7 @@ av_cold int ff_vaapi_encode_close(AVCodecContext *avctx) av_freep(&ctx->codec_sequence_params); av_freep(&ctx->codec_picture_params); +av_fifo_freep(&ctx->encode_fifo); av_buffer_unref(&ctx->recon_frames_ref); av_buffer_unref(&ctx->input_frames_ref); diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h index b41604a883..89fe8de466 100644 --- a/libavcodec/vaapi_encode.h +++ b/libavcodec/vaapi_encode.h @@ -29,6 +29,7 @@ #include "libavutil/hwcontext.h" #include "libavutil/hwcontext_vaapi.h" +#include "libavutil/fifo.h" #include "avcodec.h" #include "hwconfig.h" @@ -345,6 +346,8 @@ typedef struct VAAPIEncodeContext { int roi_warned; AVFrame *frame; + +AVFifoBuffer *encode_fifo; } VAAPIEncodeContext; enum { -- 2.25.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/3] libavcodec/vaapi_encode: Add new API adaption to vaapi_encode
Add vaSyncBuffer to VAAPI encoder. Old version API vaSyncSurface wait surface to complete. When surface is used for multiple operation, it wait all operation to finish. vaSyncBuffer only wait one channel to finish. Add wait param to vaapi_encode_wait() to prepare for the async_depth option. "wait=1" means wait until operation ready. "wait=0" means query operation's status. If ready return 0, if still in progress return EAGAIN. Signed-off-by: Wenbin Chen --- libavcodec/vaapi_encode.c | 47 +-- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index 5927849233..db0ae136a1 100644 --- a/libavcodec/vaapi_encode.c +++ b/libavcodec/vaapi_encode.c @@ -134,7 +134,8 @@ static int vaapi_encode_make_misc_param_buffer(AVCodecContext *avctx, } static int vaapi_encode_wait(AVCodecContext *avctx, - VAAPIEncodePicture *pic) + VAAPIEncodePicture *pic, + uint8_t wait) { VAAPIEncodeContext *ctx = avctx->priv_data; VAStatus vas; @@ -150,11 +151,43 @@ static int vaapi_encode_wait(AVCodecContext *avctx, "(input surface %#x).\n", pic->display_order, pic->encode_order, pic->input_surface); -vas = vaSyncSurface(ctx->hwctx->display, pic->input_surface); -if (vas != VA_STATUS_SUCCESS) { -av_log(avctx, AV_LOG_ERROR, "Failed to sync to picture completion: " - "%d (%s).\n", vas, vaErrorStr(vas)); +#if VA_CHECK_VERSION(1, 9, 0) +// Try vaSyncBuffer. +vas = vaSyncBuffer(ctx->hwctx->display, + pic->output_buffer, + wait ? VA_TIMEOUT_INFINITE : 0); +if (vas == VA_STATUS_ERROR_TIMEDOUT) { +return AVERROR(EAGAIN); +} else if (vas != VA_STATUS_SUCCESS && vas != VA_STATUS_ERROR_UNIMPLEMENTED) { +av_log(avctx, AV_LOG_ERROR, "Failed to sync to output buffer completion: " +"%d (%s).\n", vas, vaErrorStr(vas)); return AVERROR(EIO); +} else if (vas == VA_STATUS_ERROR_UNIMPLEMENTED) +// If vaSyncBuffer is not implemented, try old version API. +#endif +{ +if (!wait) { +VASurfaceStatus surface_status; +vas = vaQuerySurfaceStatus(ctx->hwctx->display, +pic->input_surface, +&surface_status); +if (vas == VA_STATUS_SUCCESS && +surface_status != VASurfaceReady && +surface_status != VASurfaceSkipped) { +return AVERROR(EAGAIN); +} else if (vas != VA_STATUS_SUCCESS) { +av_log(avctx, AV_LOG_ERROR, "Failed to query surface status: " +"%d (%s).\n", vas, vaErrorStr(vas)); +return AVERROR(EIO); +} +} else { +vas = vaSyncSurface(ctx->hwctx->display, pic->input_surface); +if (vas != VA_STATUS_SUCCESS) { +av_log(avctx, AV_LOG_ERROR, "Failed to sync to picture completion: " +"%d (%s).\n", vas, vaErrorStr(vas)); +return AVERROR(EIO); +} +} } // Input is definitely finished with now. @@ -633,7 +666,7 @@ static int vaapi_encode_output(AVCodecContext *avctx, uint8_t *ptr; int err; -err = vaapi_encode_wait(avctx, pic); +err = vaapi_encode_wait(avctx, pic, 1); if (err < 0) return err; @@ -695,7 +728,7 @@ fail: static int vaapi_encode_discard(AVCodecContext *avctx, VAAPIEncodePicture *pic) { -vaapi_encode_wait(avctx, pic); +vaapi_encode_wait(avctx, pic, 1); if (pic->output_buffer_ref) { av_log(avctx, AV_LOG_DEBUG, "Discard output for pic " -- 2.25.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 3/3] libavcodec/vaapi_encode: Add async_depth to vaapi_encoder to increase performance
Add async_depth to increase encoder's performance. Reuse encode_fifo as async buffer. Encoder puts all reordered frame to HW and then check fifo size. If fifo < async_depth and the top frame is not ready, it will return AVERROR(EAGAIN) to require more frames. 1080p transcoding (no B frames) with -async_depth=4 can increase 20% performance on my environment. The async increases performance but also introduces frame delay. Signed-off-by: Wenbin Chen --- libavcodec/vaapi_encode.c | 20 +++- libavcodec/vaapi_encode.h | 12 ++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index db0ae136a1..616fb7c089 100644 --- a/libavcodec/vaapi_encode.c +++ b/libavcodec/vaapi_encode.c @@ -1158,7 +1158,8 @@ static int vaapi_encode_send_frame(AVCodecContext *avctx, AVFrame *frame) if (ctx->input_order == ctx->decode_delay) ctx->dts_pts_diff = pic->pts - ctx->first_pts; if (ctx->output_delay > 0) -ctx->ts_ring[ctx->input_order % (3 * ctx->output_delay)] = pic->pts; +ctx->ts_ring[ctx->input_order % +(3 * ctx->output_delay + ctx->async_depth)] = pic->pts; pic->display_order = ctx->input_order; ++ctx->input_order; @@ -1212,7 +1213,8 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) return AVERROR(EAGAIN); } -while (av_fifo_size(ctx->encode_fifo) <= MAX_PICTURE_REFERENCES * sizeof(VAAPIEncodePicture *)) { +while (av_fifo_size(ctx->encode_fifo) < +MAX_ASYNC_DEPTH * sizeof(VAAPIEncodePicture *)) { pic = NULL; err = vaapi_encode_pick_next(avctx, &pic); if (err < 0) @@ -1234,6 +1236,14 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) if (!av_fifo_size(ctx->encode_fifo)) return err; +if (av_fifo_size(ctx->encode_fifo) < ctx->async_depth * sizeof(VAAPIEncodePicture *) && +!ctx->end_of_stream) { +av_fifo_generic_peek(ctx->encode_fifo, &pic, sizeof(pic), NULL); +err = vaapi_encode_wait(avctx, pic, 0); +if (err < 0) +return err; +} + av_fifo_generic_read(ctx->encode_fifo, &pic, sizeof(pic), NULL); ctx->encode_order = pic->encode_order + 1; @@ -1252,7 +1262,7 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) pkt->dts = ctx->ts_ring[pic->encode_order] - ctx->dts_pts_diff; } else { pkt->dts = ctx->ts_ring[(pic->encode_order - ctx->decode_delay) % -(3 * ctx->output_delay)]; +(3 * ctx->output_delay + ctx->async_depth)]; } av_log(avctx, AV_LOG_DEBUG, "Output packet: pts %"PRId64" dts %"PRId64".\n", pkt->pts, pkt->dts); @@ -2566,8 +2576,8 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) } } -ctx->encode_fifo = av_fifo_alloc((MAX_PICTURE_REFERENCES + 1) * - sizeof(VAAPIEncodePicture *)); +ctx->encode_fifo = av_fifo_alloc(MAX_ASYNC_DEPTH * + sizeof(VAAPIEncodePicture *)); if (!ctx->encode_fifo) return AVERROR(ENOMEM); diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h index 89fe8de466..1bf5d7c337 100644 --- a/libavcodec/vaapi_encode.h +++ b/libavcodec/vaapi_encode.h @@ -48,6 +48,7 @@ enum { MAX_TILE_ROWS = 22, // A.4.1: table A.6 allows at most 20 tile columns for any level. MAX_TILE_COLS = 20, +MAX_ASYNC_DEPTH= 64, }; extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]; @@ -298,7 +299,8 @@ typedef struct VAAPIEncodeContext { // Timestamp handling. int64_t first_pts; int64_t dts_pts_diff; -int64_t ts_ring[MAX_REORDER_DELAY * 3]; +int64_t ts_ring[MAX_REORDER_DELAY * 3 + +MAX_ASYNC_DEPTH]; // Slice structure. int slice_block_rows; @@ -348,6 +350,8 @@ typedef struct VAAPIEncodeContext { AVFrame *frame; AVFifoBuffer *encode_fifo; + +int async_depth; } VAAPIEncodeContext; enum { @@ -458,7 +462,11 @@ int ff_vaapi_encode_close(AVCodecContext *avctx); { "b_depth", \ "Maximum B-frame reference depth", \ OFFSET(common.desired_b_depth), AV_OPT_TYPE_INT, \ - { .i64 = 1 }, 1, INT_MAX, FLAGS } + { .i64 = 1 }, 1, INT_MAX, FLAGS }, \ +{ "async_depth", "Maximum processing parallelism. " \ + "Increase this to improve single channel performance", \ + OFFSET(common.async_depth), AV_OPT_TYPE_INT, \ + { .i64 = 4 }, 0, MAX_ASYNC_DEPTH, FLAGS } #define VAAPI_ENCODE_RC_MODE(name, desc) \ { #name, desc, 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_ ## name }, \ -- 2.25.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpe
Re: [FFmpeg-devel] [PATCH] avcodec/vqavideo: Decode 15-bit VQA3 files
will apply soon ___ 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 02/10] avcodec/binkaudio: Properly flush the decoder
Will this get applied anytime soon? Or should I do it? ___ 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 02/10] avcodec/binkaudio: Properly flush the decoder
On 10/27/2021 7:04 AM, Paul B Mahol wrote: Will this get applied anytime soon? Or should I do it? Andreas seems to be away, so if you don't want to wait for him to do it then imo push the any patch you think is ok. ___ 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/mxf: support MCA audio information
--- libavformat/mxf.h| 1 + libavformat/mxfdec.c | 282 ++- 2 files changed, 277 insertions(+), 6 deletions(-) diff --git a/libavformat/mxf.h b/libavformat/mxf.h index fe9c52732c..cddbcb13c9 100644 --- a/libavformat/mxf.h +++ b/libavformat/mxf.h @@ -50,6 +50,7 @@ enum MXFMetadataSetType { TaggedValue, TapeDescriptor, AVCSubDescriptor, +MCASubDescriptor, }; enum MXFFrameLayout { diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index c28549f6a9..08b196ab1f 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -51,11 +51,14 @@ #include "libavutil/mastering_display_metadata.h" #include "libavutil/mathematics.h" #include "libavcodec/bytestream.h" +#include "libavcodec/internal.h" +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "libavutil/parseutils.h" #include "libavutil/timecode.h" #include "libavutil/opt.h" #include "avformat.h" +#include "avlanguage.h" #include "internal.h" #include "mxf.h" @@ -177,6 +180,8 @@ typedef struct { int body_sid; MXFWrappingScheme wrapping; int edit_units_per_packet; /* how many edit units to read at a time (PCM, ClipWrapped) */ +int require_reordering; +int channel_ordering[FF_SANE_NB_CHANNELS]; } MXFTrack; typedef struct MXFDescriptor { @@ -205,6 +210,8 @@ typedef struct MXFDescriptor { unsigned int vert_subsampling; UID *file_descriptors_refs; int file_descriptors_count; +UID *sub_descriptors_refs; +int sub_descriptors_count; int linked_track_id; uint8_t *extradata; int extradata_size; @@ -217,6 +224,15 @@ typedef struct MXFDescriptor { size_t coll_size; } MXFDescriptor; +typedef struct MXFMCASubDescriptor { +MXFMetadataSet meta; +UID uid; +UID mca_link_id; +UID mca_group_link_id; +UID mca_label_dictionary_id; +char *language; +} MXFMCASubDescriptor; + typedef struct MXFIndexTableSegment { MXFMetadataSet meta; int edit_unit_byte_count; @@ -290,6 +306,7 @@ typedef struct MXFContext { int nb_index_tables; MXFIndexTable *index_tables; int eia608_extract; +int skip_audio_reordering; } MXFContext; /* NOTE: klv_offset is not set (-1) for local keys */ @@ -311,6 +328,9 @@ static const uint8_t mxf_system_item_key_cp[] = { 0x06,0x0e,0x2b,0x static const uint8_t mxf_system_item_key_gc[] = { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x03,0x01,0x14 }; static const uint8_t mxf_klv_key[] = { 0x06,0x0e,0x2b,0x34 }; static const uint8_t mxf_apple_coll_prefix[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x0e,0x20,0x04,0x01,0x05,0x03,0x01 }; +static const uint8_t mxf_audio_channel[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0d,0x03,0x02,0x01 }; +static const uint8_t mxf_soundfield_group[]= { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0d,0x03,0x02,0x02 }; + /* complete keys to match */ static const uint8_t mxf_crypto_source_container_ul[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x02,0x02,0x00,0x00,0x00 }; static const uint8_t mxf_encrypted_triplet_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 }; @@ -323,6 +343,15 @@ static const uint8_t mxf_indirect_value_utf16be[] = { 0x42,0x01,0x10,0x static const uint8_t mxf_apple_coll_max_cll[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x0e,0x20,0x04,0x01,0x05,0x03,0x01,0x01 }; static const uint8_t mxf_apple_coll_max_fall[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x0e,0x20,0x04,0x01,0x05,0x03,0x01,0x02 }; +static const uint8_t mxf_mca_label_dictionary_id[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x01,0x03,0x07,0x01,0x01,0x00,0x00,0x00 }; +static const uint8_t mxf_mca_tag_symbol[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x01,0x03,0x07,0x01,0x02,0x00,0x00,0x00 }; +static const uint8_t mxf_mca_tag_name[]= { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x01,0x03,0x07,0x01,0x03,0x00,0x00,0x00 }; +static const uint8_t mxf_mca_link_id[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x01,0x03,0x07,0x01,0x05,0x00,0x00,0x00 }; +static const uint8_t mxf_soundfield_group_link_id[]= { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x01,0x03,0x07,0x01,0x06,0x00,0x00,0x00 }; +static const uint8_t mxf_mca_rfc5646_spoken_language[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0d,0x03,0x01,0x01,0x02,0x03,0x15,0x00,0x00 }; + +static const uint8_t mxf_sub_descriptor[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x04,0x06,0x10,0x00,0x00 }; + static const uint8_t mxf_mastering_display_prefix[13] = { FF_MXF_MasteringDisplay_PREFIX }; static const uint8_t mxf_mastering_display_uls[4][16] = { FF_MXF_MasteringDisplayPrimaries, @@ -343,6 +372,11 @@ static void
Re: [FFmpeg-devel] [PATCH 7/8] avformat/mpegts: Fix for the DOVI video stream descriptor
On Wed, Oct 27, 2021 at 11:50:04AM +0300, Jan Ekström wrote: > On Thu, Oct 14, 2021 at 5:31 PM wrote: > > > > On Thu, Oct 14, 2021 at 10:12:05AM -0400, quietvoid wrote: > > > On Thu, Oct 14, 2021 at 9:52 AM wrote: > > > > > > > On Thu, Oct 14, 2021 at 09:45:45AM -0400, quietvoid wrote: > > > > > On Thu, Oct 14, 2021 at 9:36 AM wrote: > > > > > > > > > > > On Thu, Oct 14, 2021 at 09:18:16AM -0400, f tcChlisop0 wrote: > > > > > > > On Thu, Oct 14, 2021 at 9:10 AM wrote: > > > > > > > > > > > > > > > From: Limin Wang > > > > > > > > > > > > > > > > By < > > > > > > > Format > > > > > > v1.2>> > > > > > > > > > > > > > > > > Signed-off-by: Limin Wang > > > > > > > > --- > > > > > > > > libavformat/mpegts.c | 11 +-- > > > > > > > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > > > diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c > > > > > > > > index 44d9298..774964d 100644 > > > > > > > > --- a/libavformat/mpegts.c > > > > > > > > +++ b/libavformat/mpegts.c > > > > > > > > @@ -2178,6 +2178,8 @@ int > > > > > > > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > > *fc, > > > > > > > > AVStream *st, int stream_type > > > > > > > > AVDOVIDecoderConfigurationRecord *dovi; > > > > > > > > size_t dovi_size; > > > > > > > > int ret; > > > > > > > > +int dependency_pid; > > > > > > > > + > > > > > > > > if (desc_end - *pp < 4) // (8 + 8 + 7 + 6 + 1 + 1 + > > > > 1) / 8 > > > > > > > > return AVERROR_INVALIDDATA; > > > > > > > > > > > > > > > > @@ -2193,7 +2195,11 @@ int > > > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > > *fc, > > > > > > > > AVStream *st, int stream_type > > > > > > > > dovi->rpu_present_flag = (buf >> 2) & 0x01;// > > > > > > > > 1 > > > > bit > > > > > > > > dovi->el_present_flag = (buf >> 1) & 0x01;// > > > > > > > > 1 > > > > bit > > > > > > > > dovi->bl_present_flag = buf & 0x01;// > > > > > > > > 1 > > > > bit > > > > > > > > -if (desc_end - *pp >= 20) { // 4 + 4 * 4 > > > > > > > > +if (!dovi->bl_present_flag && desc_end - *pp >= 2) > > > > > > > > { > > > > > > > > +buf = get16(pp, desc_end); > > > > > > > > +dependency_pid = buf >> 3; // 13 bits > > > > > > > > +} > > > > > > > > +if (desc_end - *pp >= 1) { // 8 bits > > > > > > > > buf = get8(pp, desc_end); > > > > > > > > dovi->dv_bl_signal_compatibility_id = (buf >> > > > > > > > > 4) & > > > > > > 0x0f; > > > > > > > > // 4 bits > > > > > > > > } else { > > > > > > > > @@ -2210,12 +2216,13 @@ int > > > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > > *fc, > > > > > > > > AVStream *st, int stream_type > > > > > > > > } > > > > > > > > > > > > > > > > av_log(fc, AV_LOG_TRACE, "DOVI, version: %d.%d, > > > > profile: > > > > > > %d, > > > > > > > > level: %d, " > > > > > > > > - "rpu flag: %d, el flag: %d, bl flag: %d, > > > > > > compatibility > > > > > > > > id: %d\n", > > > > > > > > + "rpu flag: %d, el flag: %d, bl flag: %d, > > > > > > > > dependency_pid: %d, compatibility id: %d\n", > > > > > > > > dovi->dv_version_major, > > > > > > > > dovi->dv_version_minor, > > > > > > > > dovi->dv_profile, dovi->dv_level, > > > > > > > > dovi->rpu_present_flag, > > > > > > > > dovi->el_present_flag, > > > > > > > > dovi->bl_present_flag, > > > > > > > > + dependency_pid, > > > > > > > > dovi->dv_bl_signal_compatibility_id); > > > > > > > > } > > > > > > > > break; > > > > > > > > -- > > > > > > > > 1.8.3.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". > > > > > > > > > > > > > > > > > > > > > > Hi, this is something I had fixed in this patchset: > > > > > > > https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/286234.html > > > > > > > However the dependency_pid is ignored, as it has no use presently. > > > > > > > > > > > > > > Which patch should take precedence? > > > > > > > > > > > > Sorry, I have noticed your patch before. By the quick review of your > > > > patch, > > > > > > it's a lot function change and difficult to merge I think. I prefer > > > > > > to > > > > > > fix the issue with existing code first instead of mixed function > > > > change. > > > > > > > > > > > > > > > > Okay, that makes sense. > > > > > I will wait and rebase before resend
[FFmpeg-devel] [PATCH 1/2] avutil/parseutils: add qhd(Quad HD) or wqhd(Wide Quad HD) for 1440p
From: Limin Wang Signed-off-by: Limin Wang --- libavutil/parseutils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c index 7f678cd..19bbdde 100644 --- a/libavutil/parseutils.c +++ b/libavutil/parseutils.c @@ -102,6 +102,7 @@ static const VideoSizeAbbr video_size_abbrs[] = { { "wsxga",1600,1024 }, { "wuxga",1920,1200 }, { "woxga",2560,1600 }, +{ "wqhd", 2560,1440 }, { "wqsxga", 3200,2048 }, { "wquxga", 3840,2400 }, { "whsxga", 6400,4096 }, @@ -111,6 +112,7 @@ static const VideoSizeAbbr video_size_abbrs[] = { { "hd480", 852, 480 }, { "hd720",1280, 720 }, { "hd1080", 1920,1080 }, +{ "qhd", 2560,1440 }, { "2k", 2048,1080 }, /* Digital Cinema System Specification */ { "2kdci",2048,1080 }, { "2kflat", 1998,1080 }, -- 1.8.3.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 2/2] avformat/dashenc: Fix comparing double with 0
From: Limin Wang Signed-off-by: Limin Wang --- libavformat/dashenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 06bbf36..94e77c7 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -551,7 +551,7 @@ static void write_hls_media_playlist(OutputStream *os, AVFormatContext *s, for (i = start_index; i < os->nb_segments; i++) { Segment *seg = os->segments[i]; -if (prog_date_time == 0) { +if (fabs(prog_date_time) < 1e-7) { if (os->nb_segments == 1) prog_date_time = c->start_time_s; else -- 1.8.3.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 7/8] avformat/mpegts: Fix for the DOVI video stream descriptor
On Wed, Oct 27, 2021 at 10:26 AM wrote: > On Wed, Oct 27, 2021 at 11:50:04AM +0300, Jan Ekström wrote: > > On Thu, Oct 14, 2021 at 5:31 PM wrote: > > > > > > On Thu, Oct 14, 2021 at 10:12:05AM -0400, quietvoid wrote: > > > > On Thu, Oct 14, 2021 at 9:52 AM wrote: > > > > > > > > > On Thu, Oct 14, 2021 at 09:45:45AM -0400, quietvoid wrote: > > > > > > On Thu, Oct 14, 2021 at 9:36 AM wrote: > > > > > > > > > > > > > On Thu, Oct 14, 2021 at 09:18:16AM -0400, f tcChlisop0 wrote: > > > > > > > > On Thu, Oct 14, 2021 at 9:10 AM > wrote: > > > > > > > > > > > > > > > > > From: Limin Wang > > > > > > > > > > > > > > > > > > By < Stream Format > > > > > > > v1.2>> > > > > > > > > > > > > > > > > > > Signed-off-by: Limin Wang > > > > > > > > > --- > > > > > > > > > libavformat/mpegts.c | 11 +-- > > > > > > > > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > > > > > diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c > > > > > > > > > index 44d9298..774964d 100644 > > > > > > > > > --- a/libavformat/mpegts.c > > > > > > > > > +++ b/libavformat/mpegts.c > > > > > > > > > @@ -2178,6 +2178,8 @@ int > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > > > *fc, > > > > > > > > > AVStream *st, int stream_type > > > > > > > > > AVDOVIDecoderConfigurationRecord *dovi; > > > > > > > > > size_t dovi_size; > > > > > > > > > int ret; > > > > > > > > > +int dependency_pid; > > > > > > > > > + > > > > > > > > > if (desc_end - *pp < 4) // (8 + 8 + 7 + 6 + 1 > + 1 + > > > > > 1) / 8 > > > > > > > > > return AVERROR_INVALIDDATA; > > > > > > > > > > > > > > > > > > @@ -2193,7 +2195,11 @@ int > > > > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > > > *fc, > > > > > > > > > AVStream *st, int stream_type > > > > > > > > > dovi->rpu_present_flag = (buf >> 2) & 0x01; > // 1 > > > > > bit > > > > > > > > > dovi->el_present_flag = (buf >> 1) & 0x01; > // 1 > > > > > bit > > > > > > > > > dovi->bl_present_flag = buf & 0x01; > // 1 > > > > > bit > > > > > > > > > -if (desc_end - *pp >= 20) { // 4 + 4 * 4 > > > > > > > > > +if (!dovi->bl_present_flag && desc_end - *pp > >= 2) { > > > > > > > > > +buf = get16(pp, desc_end); > > > > > > > > > +dependency_pid = buf >> 3; // 13 bits > > > > > > > > > +} > > > > > > > > > +if (desc_end - *pp >= 1) { // 8 bits > > > > > > > > > buf = get8(pp, desc_end); > > > > > > > > > dovi->dv_bl_signal_compatibility_id = > (buf >> 4) & > > > > > > > 0x0f; > > > > > > > > > // 4 bits > > > > > > > > > } else { > > > > > > > > > @@ -2210,12 +2216,13 @@ int > > > > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > > > *fc, > > > > > > > > > AVStream *st, int stream_type > > > > > > > > > } > > > > > > > > > > > > > > > > > > av_log(fc, AV_LOG_TRACE, "DOVI, version: > %d.%d, > > > > > profile: > > > > > > > %d, > > > > > > > > > level: %d, " > > > > > > > > > - "rpu flag: %d, el flag: %d, bl flag: > %d, > > > > > > > compatibility > > > > > > > > > id: %d\n", > > > > > > > > > + "rpu flag: %d, el flag: %d, bl flag: > %d, > > > > > > > > > dependency_pid: %d, compatibility id: %d\n", > > > > > > > > > dovi->dv_version_major, > dovi->dv_version_minor, > > > > > > > > > dovi->dv_profile, dovi->dv_level, > > > > > > > > > dovi->rpu_present_flag, > > > > > > > > > dovi->el_present_flag, > > > > > > > > > dovi->bl_present_flag, > > > > > > > > > + dependency_pid, > > > > > > > > > dovi->dv_bl_signal_compatibility_id); > > > > > > > > > } > > > > > > > > > break; > > > > > > > > > -- > > > > > > > > > 1.8.3.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". > > > > > > > > > > > > > > > > > > > > > > > > > Hi, this is something I had fixed in this patchset: > > > > > > > > > https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/286234.html > > > > > > > > However the dependency_pid is ignored, as it has no use > presently. > > > > > > > > > > > > > > > > Which patch should take precedence? > > > > > > > > > > > > > > Sorry, I have noticed your patch before. By the quick review > of your > > > > > patch, > > > > > > > it's a lot function change and difficult to merge I think. I > prefer to > > > > > > > fix the issue with existing code first
[FFmpeg-devel] [PATCH 1/2] avfilter/vf_zscale: deduplicate output color information setting
This way a piece of logic is not missed in one location or the other, such as the case with chroma location outside the if. --- libavfilter/vf_zscale.c | 45 ++--- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c index 3f7dba489a..439c0c8548 100644 --- a/libavfilter/vf_zscale.c +++ b/libavfilter/vf_zscale.c @@ -554,6 +554,24 @@ fail: return ret; } +static void update_output_color_information(ZScaleContext *s, AVFrame *frame) +{ +if (s->colorspace != -1) +frame->colorspace = (int)s->dst_format.matrix_coefficients; + +if (s->primaries != -1) +frame->color_primaries = (int)s->dst_format.color_primaries; + +if (s->range != -1) +frame->color_range = convert_range_from_zimg(s->dst_format.pixel_range); + +if (s->trc != -1) +frame->color_trc = (int)s->dst_format.transfer_characteristics; + +if (s->chromal != -1) +frame->chroma_location = (int)s->dst_format.chroma_location - 1; +} + static int filter_frame(AVFilterLink *link, AVFrame *in) { ZScaleContext *s = link->dst->priv; @@ -621,20 +639,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) format_init(&s->dst_format, out, odesc, s->colorspace, s->primaries, s->trc, s->range, s->chromal); -if (s->colorspace != -1) -out->colorspace = (int)s->dst_format.matrix_coefficients; - -if (s->primaries != -1) -out->color_primaries = (int)s->dst_format.color_primaries; - -if (s->range != -1) -out->color_range = convert_range_from_zimg(s->dst_format.pixel_range); - -if (s->trc != -1) -out->color_trc = (int)s->dst_format.transfer_characteristics; - -if (s->chromal != -1) -out->chroma_location = (int)s->dst_format.chroma_location - 1; +update_output_color_information(s, out); ret = graph_build(&s->graph, &s->params, &s->src_format, &s->dst_format, &s->tmp, &s->tmp_size); @@ -680,17 +685,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) } } -if (s->colorspace != -1) -out->colorspace = (int)s->dst_format.matrix_coefficients; - -if (s->primaries != -1) -out->color_primaries = (int)s->dst_format.color_primaries; - -if (s->range != -1) -out->color_range = convert_range_from_zimg(s->dst_format.pixel_range); - -if (s->trc != -1) -out->color_trc = (int)s->dst_format.transfer_characteristics; +update_output_color_information(s, out); av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den, (int64_t)in->sample_aspect_ratio.num * outlink->h * link->w, -- 2.31.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 2/2] avfilter/vf_zscale: fix mapping of zimg_chroma_location_e to AVChromaLocation
The AVChromaLocation values are one higher than zimg's, not one lower as the undefined value is set to zero (as opposed to zimg's -1). --- libavfilter/vf_zscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c index 439c0c8548..1288c5efc1 100644 --- a/libavfilter/vf_zscale.c +++ b/libavfilter/vf_zscale.c @@ -569,7 +569,7 @@ static void update_output_color_information(ZScaleContext *s, AVFrame *frame) frame->color_trc = (int)s->dst_format.transfer_characteristics; if (s->chromal != -1) -frame->chroma_location = (int)s->dst_format.chroma_location - 1; +frame->chroma_location = (int)s->dst_format.chroma_location + 1; } static int filter_frame(AVFilterLink *link, AVFrame *in) -- 2.31.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/2] avfilter/vf_zscale: deduplicate output color information setting
lgtm ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] avfilter/vf_zscale: fix mapping of zimg_chroma_location_e to AVChromaLocation
probably fine ___ 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 7/8] avformat/mpegts: Fix for the DOVI video stream descriptor
On Wed, Oct 27, 2021 at 10:54:31AM -0400, quietvoid wrote: > On Wed, Oct 27, 2021 at 10:26 AM wrote: > > > On Wed, Oct 27, 2021 at 11:50:04AM +0300, Jan Ekström wrote: > > > On Thu, Oct 14, 2021 at 5:31 PM wrote: > > > > > > > > On Thu, Oct 14, 2021 at 10:12:05AM -0400, quietvoid wrote: > > > > > On Thu, Oct 14, 2021 at 9:52 AM wrote: > > > > > > > > > > > On Thu, Oct 14, 2021 at 09:45:45AM -0400, quietvoid wrote: > > > > > > > On Thu, Oct 14, 2021 at 9:36 AM wrote: > > > > > > > > > > > > > > > On Thu, Oct 14, 2021 at 09:18:16AM -0400, f tcChlisop0 wrote: > > > > > > > > > On Thu, Oct 14, 2021 at 9:10 AM > > wrote: > > > > > > > > > > > > > > > > > > > From: Limin Wang > > > > > > > > > > > > > > > > > > > > By < > Stream Format > > > > > > > > v1.2>> > > > > > > > > > > > > > > > > > > > > Signed-off-by: Limin Wang > > > > > > > > > > --- > > > > > > > > > > libavformat/mpegts.c | 11 +-- > > > > > > > > > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > > > > > > > diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c > > > > > > > > > > index 44d9298..774964d 100644 > > > > > > > > > > --- a/libavformat/mpegts.c > > > > > > > > > > +++ b/libavformat/mpegts.c > > > > > > > > > > @@ -2178,6 +2178,8 @@ int > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > > > > *fc, > > > > > > > > > > AVStream *st, int stream_type > > > > > > > > > > AVDOVIDecoderConfigurationRecord *dovi; > > > > > > > > > > size_t dovi_size; > > > > > > > > > > int ret; > > > > > > > > > > +int dependency_pid; > > > > > > > > > > + > > > > > > > > > > if (desc_end - *pp < 4) // (8 + 8 + 7 + 6 + 1 > > + 1 + > > > > > > 1) / 8 > > > > > > > > > > return AVERROR_INVALIDDATA; > > > > > > > > > > > > > > > > > > > > @@ -2193,7 +2195,11 @@ int > > > > > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > > > > *fc, > > > > > > > > > > AVStream *st, int stream_type > > > > > > > > > > dovi->rpu_present_flag = (buf >> 2) & 0x01; > > // 1 > > > > > > bit > > > > > > > > > > dovi->el_present_flag = (buf >> 1) & 0x01; > > // 1 > > > > > > bit > > > > > > > > > > dovi->bl_present_flag = buf & 0x01; > > // 1 > > > > > > bit > > > > > > > > > > -if (desc_end - *pp >= 20) { // 4 + 4 * 4 > > > > > > > > > > +if (!dovi->bl_present_flag && desc_end - *pp > > >= 2) { > > > > > > > > > > +buf = get16(pp, desc_end); > > > > > > > > > > +dependency_pid = buf >> 3; // 13 bits > > > > > > > > > > +} > > > > > > > > > > +if (desc_end - *pp >= 1) { // 8 bits > > > > > > > > > > buf = get8(pp, desc_end); > > > > > > > > > > dovi->dv_bl_signal_compatibility_id = > > (buf >> 4) & > > > > > > > > 0x0f; > > > > > > > > > > // 4 bits > > > > > > > > > > } else { > > > > > > > > > > @@ -2210,12 +2216,13 @@ int > > > > > > ff_parse_mpeg2_descriptor(AVFormatContext > > > > > > > > *fc, > > > > > > > > > > AVStream *st, int stream_type > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > av_log(fc, AV_LOG_TRACE, "DOVI, version: > > %d.%d, > > > > > > profile: > > > > > > > > %d, > > > > > > > > > > level: %d, " > > > > > > > > > > - "rpu flag: %d, el flag: %d, bl flag: > > %d, > > > > > > > > compatibility > > > > > > > > > > id: %d\n", > > > > > > > > > > + "rpu flag: %d, el flag: %d, bl flag: > > %d, > > > > > > > > > > dependency_pid: %d, compatibility id: %d\n", > > > > > > > > > > dovi->dv_version_major, > > dovi->dv_version_minor, > > > > > > > > > > dovi->dv_profile, dovi->dv_level, > > > > > > > > > > dovi->rpu_present_flag, > > > > > > > > > > dovi->el_present_flag, > > > > > > > > > > dovi->bl_present_flag, > > > > > > > > > > + dependency_pid, > > > > > > > > > > dovi->dv_bl_signal_compatibility_id); > > > > > > > > > > } > > > > > > > > > > break; > > > > > > > > > > -- > > > > > > > > > > 1.8.3.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". > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi, this is something I had fixed in this patchset: > > > > > > > > > > > https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/286234.html > > > > > > > > > However the dependency_pid is ignored, as it has no use > > presently. > > > > > > > > > > > > > > > > >
Re: [FFmpeg-devel] [PATCH 3/5] avformat/imf: Demuxer implementation
On Wed, Oct 27, 2021 at 12:54 AM Paul B Mahol wrote: > > > > On Fri, Oct 8, 2021 at 1:42 AM wrote: >> >> From: Pierre-Anthony Lemieux >> >> Signed-off-by: Pierre-Anthony Lemieux >> --- >> >> Notes: >> Implements the IMF demuxer. >> >> libavformat/imfdec.c | 660 +++ >> 1 file changed, 660 insertions(+) >> create mode 100644 libavformat/imfdec.c >> >> diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c >> new file mode 100644 >> index 00..0c64fe0c03 >> --- /dev/null >> +++ b/libavformat/imfdec.c >> @@ -0,0 +1,660 @@ >> +/* >> + * Copyright (c) Sandflow Consulting LLC >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions are >> met: >> + * >> + * * Redistributions of source code must retain the above copyright notice, >> this >> + * list of conditions and the following disclaimer. >> + * * Redistributions in binary form must reproduce the above copyright >> notice, >> + * this list of conditions and the following disclaimer in the >> documentation >> + * and/or other materials provided with the distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS >> IS" >> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >> PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE >> + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >> + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >> + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >> + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >> + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >> THE >> + * POSSIBILITY OF SUCH DAMAGE. >> + * >> + * 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 >> + */ >> + >> +/** >> + * Demuxes an IMF Composition >> + * >> + * References >> + * OV 2067-0:2018 - SMPTE Overview Document - Interoperable Master Format >> + * ST 2067-2:2020 - SMPTE Standard - Interoperable Master Format — Core >> Constraints >> + * ST 2067-3:2020 - SMPTE Standard - Interoperable Master Format — >> Composition Playlist >> + * ST 2067-5:2020 - SMPTE Standard - Interoperable Master Format — Essence >> Component >> + * ST 2067-20:2016 - SMPTE Standard - Interoperable Master Format — >> Application #2 >> + * ST 2067-21:2020 - SMPTE Standard - Interoperable Master Format — >> Application #2 Extended >> + * ST 2067-102:2017 - SMPTE Standard - Interoperable Master Format — Common >> Image Pixel Color Schemes >> + * ST 429-9:2007 - SMPTE Standard - D-Cinema Packaging — Asset Mapping and >> File Segmentation >> + * >> + * @author Marc-Antoine Arnaud >> + * @author Valentin Noel >> + * @file >> + * @ingroup lavu_imf >> + */ >> + >> +#include "imf.h" >> +#include "imf_internal.h" >> +#include "internal.h" >> +#include "libavutil/opt.h" >> +#include "libavutil/bprint.h" >> +#include "libavutil/avstring.h" >> +#include "mxf.h" >> +#include "url.h" >> +#include >> +#include >> + >> +#define MAX_BPRINT_READ_SIZE (UINT_MAX - 1) >> +#define DEFAULT_ASSETMAP_SIZE 8 * 1024 >> + >> +typedef struct IMFVirtualTrackResourcePlaybackCtx { >> +IMFAssetLocator *locator; >> +IMFTrackFileResource *resource; >> +AVFormatContext *ctx; >> +} IMFVirtualTrackResourcePlaybackCtx; >> + >> +typedef struct IMFVirtualTrackPlaybackCtx { >> +// Track index in playlist >> +int32_t index; >> +// Time counters >> +AVRational current_timestamp; >> +AVRational duration; >> +// Resources >> +unsigned int resource_count; >> +IMFVirtualTrackResourcePlaybackCtx **resources; >> +// Decoding cursors >> +uint32_t current_resource_index; >> +int64_t last_pts; >> +} IMFVirtualTrackPlaybackCtx; >> + >> +typedef struct IMFContext { >> +const AVClass *class; >> +const char *base_url; >> +char *asset_map_paths; >> +AVIOInterruptCB *interrupt_c
Re: [FFmpeg-devel] [PATCH 2/5] avformat/imf: CPL processor
On Wed, Oct 27, 2021 at 12:57 AM Paul B Mahol wrote: > > > > On Wed, Oct 20, 2021 at 4:55 PM wrote: >> >> From: Pierre-Anthony Lemieux >> >> Signed-off-by: Pierre-Anthony Lemieux >> --- >> >> Notes: >> Implements IMF Composition Playlist (CPL) parsing. >> >> libavformat/imf_cpl.c | 666 ++ >> 1 file changed, 666 insertions(+) >> create mode 100644 libavformat/imf_cpl.c >> >> diff --git a/libavformat/imf_cpl.c b/libavformat/imf_cpl.c >> new file mode 100644 >> index 00..8ef574ad78 >> --- /dev/null >> +++ b/libavformat/imf_cpl.c >> @@ -0,0 +1,666 @@ >> +/* >> + * Copyright (c) Sandflow Consulting LLC >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions are >> met: >> + * >> + * * Redistributions of source code must retain the above copyright notice, >> this >> + * list of conditions and the following disclaimer. >> + * * Redistributions in binary form must reproduce the above copyright >> notice, >> + * this list of conditions and the following disclaimer in the >> documentation >> + * and/or other materials provided with the distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS >> IS" >> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >> PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE >> + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >> + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >> + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >> + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >> + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >> THE >> + * POSSIBILITY OF SUCH DAMAGE. >> + * >> + * 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 >> + */ >> + >> +/** >> + * Implements IMP CPL processing >> + * >> + * @author Pierre-Anthony Lemieux >> + * @file >> + * @ingroup lavu_imf >> + */ >> + >> +#include "imf.h" >> +#include "imf_internal.h" >> +#include "libavformat/mxf.h" >> +#include "libavutil/bprint.h" >> +#include "libavutil/error.h" >> +#include >> + >> +xmlNodePtr xml_get_child_element_by_name(xmlNodePtr parent, const char >> *name_utf8) { >> +xmlNodePtr cur_element; >> + >> +cur_element = xmlFirstElementChild(parent); >> +while (cur_element) { >> +if (xmlStrcmp(cur_element->name, name_utf8) == 0) >> +return cur_element; >> +cur_element = xmlNextElementSibling(cur_element); >> +} >> +return NULL; >> +} >> + >> +int xml_read_UUID(xmlNodePtr element, uint8_t uuid[16]) { >> +xmlChar *element_text = NULL; >> +int scanf_ret; >> +int ret = 0; >> + >> +element_text = xmlNodeListGetString(element->doc, >> element->xmlChildrenNode, 1); >> +scanf_ret = sscanf(element_text, >> +UUID_FORMAT, >> +&uuid[0], >> +&uuid[1], >> +&uuid[2], >> +&uuid[3], >> +&uuid[4], >> +&uuid[5], >> +&uuid[6], >> +&uuid[7], >> +&uuid[8], >> +&uuid[9], >> +&uuid[10], >> +&uuid[11], >> +&uuid[12], >> +&uuid[13], >> +&uuid[14], >> +&uuid[15]); >> +if (scanf_ret != 16) { >> +av_log(NULL, AV_LOG_ERROR, "Invalid UUID\n"); >> +ret = AVERROR_INVALIDDATA; >> +} >> +xmlFree(element_text); >> + >> +return ret; >> +} >> + >> +int xml_read_rational(xmlNodePtr element, AVRational *rational) { >> +xmlChar *element_text = NULL; >> +int ret = 0; >> + >> +element_text = xmlNodeListGetString(element->doc, >> element->xmlChildrenNode, 1); >> +if (sscanf(element_text, "%i %i", &rational->num, &rational->den) != 2) >> { >> +av_log(NULL, AV_LOG_ERROR, "Invalid rational number\n"); >> +ret = AVERROR_INVALIDDATA; >> +} >> +xmlFree(element_text); >> + >> +return ret; >
[FFmpeg-devel] [PATCH] flvenc: flush after write header
keep align with movenc, or it seems a little weired when debug --- libavformat/flvenc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 3f24c7e192..f4798dc9a6 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -767,6 +767,8 @@ static int flv_write_header(AVFormatContext *s) flv_write_codec_header(s, s->streams[i]->codecpar, 0); } +avio_flush(pb); + flv->datastart_offset = avio_tell(pb); return 0; } -- 2.29.2 ___ 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".