From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D684745D45 for ; Sun, 7 May 2023 08:57:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0539768BFF2; Sun, 7 May 2023 11:57:43 +0300 (EEST) Received: from out203-205-251-84.mail.qq.com (unknown [203.205.251.84]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D8E3768BF4D for ; Sun, 7 May 2023 11:57:34 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1683449845; bh=S7TYOtwhvd00dbr+IBG5c7Tb0eiBN/NpBnxUkDS1dBs=; h=Subject:From:To:Date:In-Reply-To:References; b=wdOU3rHAmuOc9ep8g8gcIGj8ZE5vTcEUp35vtxxWTLkpuBA8+fNINcLd58NYfScvm Kin0iGZpAET2J8AvdfaU0KNhzSZ0tnELeaIR7komlGzrIyZghNUxU9+HXPfxpbz+Qu puTud6IMFSLrNdqEUq6sJxoEnzE5kXvLo4+mYuo8= Received: from [127.0.0.1] ([113.118.112.30]) by newxmesmtplogicsvrszb9-0.qq.com (NewEsmtp) with SMTP id E58094F0; Sun, 07 May 2023 16:57:24 +0800 X-QQ-mid: xmsmtpt1683449844temlu93cr Message-ID: X-QQ-XMAILINFO: NY/MPejODIJVX/zA3iVu2t2QgZrCpgw3Fb7Epqrh18zlxtk/a7ylBtjKu4yvuY KJQPRImH1Lz+yicO+kbHoIpRW3UqB051sGs0jTHi95glL1vD4rhjLDSAz52dc9J1b5Oe6XzVqdaD lb/DITojkKIMVpp9bHIsQ0CeY+1e1vgpetJ5jHE2LZDowgItcBTNEefTESRiXP/pt/V24sxgfSUe yrGy2nA2GpEF58GF694hgEqDYetzh0w5PxYvHQw5lRz3aFQ7EDo6kJrKWHhy8dQxLs+TsNZJgK62 HhPgAHQMW5JU9fKVhHryF1tkYwETjjlvwbZWe6lTCA2fEOB+7F0m/w/wzeOHAtk8yvGNG3nocHgn 7Jq5rYAsJDniNAPoYH8pSDHvr9NFA+2ZQJu/jaCzKdDyAXOjCyeOCOmG9vfDVCDyz8IF6Suzhhsy TuwEe+HKIWxWlmgiQDBY1sbUFlS2r0N2SG8U2cHraWGaF6vVPqryQtWb6EcjFJIqO6PbwJSN/ncG FrSWtO+g0rNnNP0PDzTFLDxKDaJXl8ekbwdgQKkT5B6g2Uyysp9ie85F16GjZfyQChNLGXhEdBFy qjm2vkCwaWB5Nuwou9+EHr5l6ziQdSR+CGmMcSfs6JbLBVtzE6Qmx7wa1X9j2cjW88Y+JERJ6Stm mv0WisB4nnd/vdwP+sDr4MWOziT6Q+MOB2qaZ0j1LeqOiuZH8SOYfeOHU0XeERd1GbGbgHqQeG74 kjtTU/DSM6iJtaPDmISJ4lUVZWVErIRbUULK5lciat94o9Th6sF7EdwX7hyia1tW8gbBxpQAqnoW UV2dS54lSoCkHaYWQZy8adWWQl7Z5JJae2FJfl6J7SdBLpfW+QfWaFBHxLLun654/drCMcg2MDDu +jrfLB5RW+cQAYL2+uCiyW2YCybghu3TqnGpC72ffMAMYMVW9eHYrE3YDwMep4UGNefUxKbY2ndo KWPZiPR8DXYg8j+qWDdpCc0fQg+cm9 X-OQ-MSGID: <64087f09f951ca839b475d78741898c48c088af3.camel@foxmail.com> From: Zhao Zhili To: Samuel Raposo Vieira Mira , FFmpeg development discussions and patches Date: Sun, 07 May 2023 16:57:22 +0800 In-Reply-To: References: User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2] avcodec/mediacodec: Add AV1 encoder 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, 2023-05-02 at 12:22 +0000, Samuel Raposo Vieira Mira wrote: > @@ -3162,6 +3162,7 @@ aac_mf_encoder_deps="mediafoundation" > ac3_mf_encoder_deps="mediafoundation" > av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS" > av1_mediacodec_decoder_deps="mediacodec" > +av1_mediacodec_encoder_deps="mediacodec" This patch format is broken too. > > diff --git a/libavcodec/mediacodec_wrapper.c b/libavcodec/mediacodec_wrapper.c > index 1c29bb7406..015f275a0f 100644 > --- a/libavcodec/mediacodec_wrapper.c > +++ b/libavcodec/mediacodec_wrapper.c > @@ -35,6 +35,8 @@ > #include "ffjni.h" > #include "mediacodec_wrapper.h" > +#include "libavutil/pixdesc.h" > + Please keep the include in some order. > struct JNIAMediaCodecListFields { > jclass mediacodec_list_class; > @@ -345,6 +347,11 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx) > static const int MPEG4ProfileAdvancedScalable = 0x4000; > static const int MPEG4ProfileAdvancedSimple = 0x8000; Missing an empty line between MPEG4 and AV1. > + static const int AV1ProfileMain8 = 0x1; > + static const int AV1ProfileMain10 = 0x2; > + static const int AV1ProfileMain10HDR10 = 0x1000; > + static const int AV1ProfileMain10HDR10Plus = 0x2000; > + > // Unused yet. > (void)AVCProfileConstrainedHigh; > (void)HEVCProfileMain10HDR10; > @@ -353,6 +360,8 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx) > (void)VP9Profile3HDR; > (void)VP9Profile2HDR10Plus; > (void)VP9Profile3HDR10Plus; > + (void)AV1ProfileMain10HDR10; > + (void)AV1ProfileMain10HDR10Plus; > if (avctx->codec_id == AV_CODEC_ID_H264) { > switch(avctx->profile) { > @@ -436,6 +445,9 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx) > default: > break; > } > + } else if(avctx->codec_id == AV_CODEC_ID_AV1) { > + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); > + return desc != NULL && desc->comp[0].depth == 8? AV1ProfileMain8 : AV1ProfileMain10; > } I'm not sure about how mediacodec handles 10bit encoding and need some tests. Let's keep the function simple first by just map avctx->profile to MediaCodec profile. > return -1; > diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c > index e4b583a542..10da43c3e7 100644 > --- a/libavcodec/mediacodecenc.c > +++ b/libavcodec/mediacodecenc.c > @@ -170,6 +170,9 @@ static av_cold int mediacodec_init(AVCodecContext *avctx) > case AV_CODEC_ID_MPEG4: > codec_mime = "video/mp4v-es"; > break; > + case AV_CODEC_ID_AV1: > + codec_mime = "video/av01"; > + break; > default: > av_assert0(0); > } > @@ -779,16 +782,16 @@ DECLARE_MEDIACODEC_ENCODER(hevc, "H.265", AV_CODEC_ID_HEVC) > enum MediaCodecVP9Level { > VP9Level1 = 0x1, > - VP9Level11 = 0x2, > + VP9Level11 = 0x2, > VP9Level2 = 0x4, > - VP9Level21 = 0x8, > - VP9Level3 = 0x10, > + VP9Level21 = 0x8, > + VP9Level3 = 0x10, > VP9Level31 = 0x20, > VP9Level4 = 0x40, > - VP9Level41 = 0x80, > - VP9Level5 = 0x100, > + VP9Level41 = 0x80, > + VP9Level5 = 0x100, > VP9Level51 = 0x200, > - VP9Level52 = 0x400, > + VP9Level52 = 0x400, > VP9Level6 = 0x800, > VP9Level61 = 0x1000, > VP9Level62 = 0x2000, > @@ -837,15 +840,15 @@ DECLARE_MEDIACODEC_ENCODER(vp9, "VP9", AV_CODEC_ID_VP9) > enum MediaCodecMpeg4Level { > MPEG4Level0 = 0x01, > - MPEG4Level0b = 0x02, > - MPEG4Level1 = 0x04, > + MPEG4Level0b = 0x02, > + MPEG4Level1 = 0x04, > MPEG4Level2 = 0x08, > - MPEG4Level3 = 0x10, > + MPEG4Level3 = 0x10, > MPEG4Level3b = 0x18, > - MPEG4Level4 = 0x20, > - MPEG4Level4a = 0x40, > + MPEG4Level4 = 0x20, > + MPEG4Level4a = 0x40, > MPEG4Level5 = 0x80, > - MPEG4Level6 = 0x100, > + MPEG4Level6 = 0x100, > }; Don't do unrelated code format in this patch. By the way, which hardware did you use to run the test? _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".