From patchwork Fri Feb 10 17:40:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Siedel X-Patchwork-Id: 34889 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp1565288pzk; Fri, 10 Feb 2023 09:41:48 -0800 (PST) X-Google-Smtp-Source: AK7set96CbUlUPWec6rWBltEDy41Nof1adcCEBy7n6YXP56O9aBdzJ7JAPBGiHdRBvY3CnkNZoY6 X-Received: by 2002:a50:c053:0:b0:4ab:c411:8ac5 with SMTP id u19-20020a50c053000000b004abc4118ac5mr2168636edd.17.1676050908395; Fri, 10 Feb 2023 09:41:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676050908; cv=none; d=google.com; s=arc-20160816; b=ohoCBabhVRnYuDHAJBZPWdbWUPLfxejCAHEGqT5kQM3EdsPQkUJcRZeM8mdX4HZnkU 4g0PDSyPSyKUE4DjFLYwRTjLTReXKZcBAr9VuBNWiVlmp48fgjVHf/Y7fnRIEZKPPtjD sKiAYeHpn1WStjLcKCqYuBZXNqVVzLGwcaAYzCLz/V0xbPMr3tPqTHU9C/diiZY/Zl/5 kKuNhTemxhH/fd3neLmpSLmO28bwV7PgogM6Lr7V7JCxNmr0sY7tcE7e3dp7QxcyAt4Q yQI+FvJaUIcCeW35qERKqJPwvvd6+kgGZv+VTYQYtv6EPI7y6SeN2Uso9kPDCYCWNl5A VQPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=YLz+9+KGIORszhb1LFVVzm3E1b5UCRP2+rypuNSHfJo=; b=0Ka6A63t28mAxJHibwjhoLV+CuYsD+Gup0sUEP/C9FB/A+g2rI951sfAyn8TA+gRpE 0eDpNVBYQMIFeyqfrU8PLD+TrTqNeEZlFze3ecqaoBwY4HBUsXFB1nuxAS+LAvavC+2q rYciE4bhhSivOYc68BnGcdJ5A12NNE/eymGpB57MY1dfLuwQ2dFwM1i2Yw8n72fdu0iG RU07Vu7nX0JMcJO2T7Nin6Gkp/+QKaBEhQvspwvH46L0rmA+QYGZYisHp90HQRdQDtuw FCApJXqb8PYWMzxy2HXmyqHNF/e7DH2IN2+A35Y+4tEc131BP8XerN+0cEtwAXichS5g b4Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@spin-digital-com.20210112.gappssmtp.com header.s=20210112 header.b=0PohXXxL; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d12-20020aa7c1cc000000b0049e34ecef51si6178640edp.517.2023.02.10.09.41.47; Fri, 10 Feb 2023 09:41:48 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@spin-digital-com.20210112.gappssmtp.com header.s=20210112 header.b=0PohXXxL; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5406668B2F6; Fri, 10 Feb 2023 19:41:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CD60768B2F6 for ; Fri, 10 Feb 2023 19:41:37 +0200 (EET) Received: by mail-wr1-f49.google.com with SMTP id j25so5806559wrc.4 for ; Fri, 10 Feb 2023 09:41:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spin-digital-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=CsWNqYnzAp0WbQk/Ca7dAR08XQp8nhWOLSrateo8W0c=; b=0PohXXxLgOQ6o8l+kywbTm0gdcCqSUr4V3Yeh0+snX+LPZqVERUZkG8XCB4fcb9cgW 1TmWqCxhhYQfx00xYvOhMaHqI24aGC2aunFoW+8dndp3EFM2MK0YyO1oGf5Eb3/q9CcV XYhswZQDts/+N0aUlANFRnBTeZed25B8XftTSBcwhdZ2Ccsq7DQ5vpt70fHM7ZF8VNfR CahwqqteMDSF+GR9oiYwaOkbrONFsy37bCoioch79taKlcQmHTcUmpySPL8hfXalpgAr AooZhcVVwouWz3dtDIoSefecysiLhebnkkUAQrONdEPX/Kn0ipzQm1CSdckM0OBa4AdY I7dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CsWNqYnzAp0WbQk/Ca7dAR08XQp8nhWOLSrateo8W0c=; b=5FVyc1CDR7aG1BjgPLFbElIBbRak594uBYLPA6ZrWc6t01L0rRdEH+JWcmWG4MJTB4 0tIGtyR9sBuw6BWmLFbhVLay4AbaOkiNFL+3ceGc4XlrE/Pf3i0TB/C6vw1jFTDuh5/H RfPJwQ8ahujHTJvccOdGTbP83vjZZUv9h9VUdzPu9l9OxhX2glTXzkNdU+4oIpd64SG1 UISL3I/8OzZg3PbU7THSYknK3r74wKgx2QvgPUbIBIyzVyCcym7QcbVqpVgUX9SEXzhf DHEDEpdoWndz1ewjswV2hfA2MywNONzKo3TSRpgGinostvHulxLUr3z7o4nTjVLbhVHy p75A== X-Gm-Message-State: AO0yUKU2s+KFD3CjXezjVBOLnBNolOlqJtUoIwT3pCNMM96XvbtV6ycR Iw5WZoPLcgY7uDHVhFRBKlooBCz4GkzqE6NK X-Received: by 2002:a5d:6287:0:b0:2bd:d9b5:8191 with SMTP id k7-20020a5d6287000000b002bdd9b58191mr13047577wru.61.1676050896643; Fri, 10 Feb 2023 09:41:36 -0800 (PST) Received: from thomas-win.localdomain ([213.138.44.237]) by smtp.gmail.com with ESMTPSA id w13-20020a5d608d000000b002c54b6382c8sm1589245wrt.82.2023.02.10.09.41.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 09:41:36 -0800 (PST) From: Thomas Siedel To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Feb 2023 18:40:55 +0100 Message-Id: <20230210174106.44514-1-thomas.ff@spin-digital.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v6 00/11] Add support for H266/VVC X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: pVkZM5OzJiKv This patch set adds H266/VVC support. This includes parsing, muxing, demuxing, decoding and encoding. Decoding is done using the external library VVdeC (https://github.com/fraunhoferhhi/vvdec.git) and can be enabled with --enable-libvvdec. Encoding is done using the external library VVenC (https://github.com/fraunhoferhhi/vvenc.git) and can be enabled with --enable-libvvenc. Changes since v5: general: - align filename to h266 pattern ( feedback zhilizhao(赵志立) ) - mv vvc_mp4toannexb_bsf h266_mp4toannexb_bsf - mv vvc_paramset h266_paramset - mv vvc.h/.c h266.h./c - mv vvcdec h266dec - mv vvc_parse_extradata h266_parse_extradata - mv vvc_parser h266_parser - rename functions in renamed files to h266 syntax - split patch 4 into 2 seperated patches PATCH 2/10 ( feedback zhilizhao(赵志立) ) - cbs_h266_syntax_template: replacing h266_ceil() with AV_CEIL_RSHIFT() - bugfix: cbs_h266_free_sei: using H266RawSEI instead of H265RawSEI PATCH 3/10 - bugfix: h266_parser.c parse_nal_units() parsing all frames correctly (before frames could be missing) PATCH 4/10 ( feedback zhilizhao(赵志立) ) - mv vvc_mp4toannexb_bsf h266_mp4toannexb_bsf - add IS_H266_SLICE in cbs_h266.h (remove duplicate macro from vvc_parser.c h266_metadata.bsf ) - bitstream_filters.c sort FFBitStreamFilter - h266_metadata_update_fragment: check pkt!=NULL, replace else{ if() } by else if() split Patch 4 into separate patches - PATCH 4 is now h266_metadata_bsf - PATCH 5 is h266_mp4toannexb_bsf PATH 8/10 - cleanup h266_paramset.h ( remove duplicate structs from cbs_h266.h) Nuo Mi (4): avcodec: add enum types for H266/VVC avcodec: add cbs for H266/VVC avcodec: add bitstream parser for H266/VVC avcodec: add h266_metadata_bsf support for H266/VVC Thomas Siedel (7): avcodec: add MP4 to annexb support for H266/VVC avformat: add demuxer and probe support for H266/VVC avformat: add muxer support for H266/VVC avcodec: add external decoder libvvdec for H266/VVC avcodec: add external encoder libvvenc for H266/VVC avformat: add ts stream types for H266/VVC avcodec: increase minor version for H266/VVC configure | 16 +- libavcodec/Makefile | 6 + libavcodec/allcodecs.c | 2 + libavcodec/bitstream_filters.c | 2 + libavcodec/cbs.c | 6 + libavcodec/cbs_h2645.c | 370 ++- libavcodec/cbs_h266.h | 793 +++++++ libavcodec/cbs_h266_syntax_template.c | 3096 +++++++++++++++++++++++++ libavcodec/cbs_internal.h | 1 + libavcodec/cbs_sei.c | 29 + libavcodec/h2645_parse.c | 71 +- libavcodec/h266.h | 142 ++ libavcodec/h266_metadata_bsf.c | 147 ++ libavcodec/h266_mp4toannexb_bsf.c | 329 +++ libavcodec/h266_paramset.c | 1005 ++++++++ libavcodec/h266_paramset.h | 307 +++ libavcodec/h266_parse_extradata.c | 249 ++ libavcodec/h266_parse_extradata.h | 36 + libavcodec/h266_parser.c | 601 +++++ libavcodec/libvvdec.c | 548 +++++ libavcodec/libvvenc.c | 469 ++++ libavcodec/parsers.c | 1 + libavcodec/version.h | 2 +- libavformat/Makefile | 8 +- libavformat/allformats.c | 2 + libavformat/demux.c | 7 +- libavformat/h266.c | 984 ++++++++ libavformat/h266.h | 99 + libavformat/h266dec.c | 61 + libavformat/isom.c | 1 + libavformat/isom_tags.c | 3 + libavformat/mov.c | 6 + libavformat/movenc.c | 41 +- libavformat/mpeg.c | 3 + libavformat/mpeg.h | 1 + libavformat/mpegts.c | 2 + libavformat/mpegts.h | 1 + libavformat/mpegtsenc.c | 65 + libavformat/rawenc.c | 23 + 39 files changed, 9523 insertions(+), 12 deletions(-) create mode 100644 libavcodec/cbs_h266.h create mode 100644 libavcodec/cbs_h266_syntax_template.c create mode 100644 libavcodec/h266.h create mode 100644 libavcodec/h266_metadata_bsf.c create mode 100644 libavcodec/h266_mp4toannexb_bsf.c create mode 100644 libavcodec/h266_paramset.c create mode 100644 libavcodec/h266_paramset.h create mode 100644 libavcodec/h266_parse_extradata.c create mode 100644 libavcodec/h266_parse_extradata.h create mode 100644 libavcodec/h266_parser.c create mode 100644 libavcodec/libvvdec.c create mode 100644 libavcodec/libvvenc.c create mode 100644 libavformat/h266.c create mode 100644 libavformat/h266.h create mode 100644 libavformat/h266dec.c