AV1 support

This commit is contained in:
Patrick Nicolas
2024-08-31 22:07:56 +02:00
parent 8b611ee609
commit 7a42691269
11 changed files with 24 additions and 125 deletions
-5
View File
@@ -99,11 +99,6 @@ void AvDeleter::operator()(AVCodecContext * x)
avcodec_free_context(&x);
}
void AvDeleter::operator()(AVFilterGraph * x)
{
avfilter_graph_free(&x);
}
void AvDeleter::operator()(AVPacket * x)
{
av_packet_free(&x);
-4
View File
@@ -24,7 +24,6 @@
#include <vulkan/vulkan_core.h>
struct AVBufferRef;
struct AVFilterGraph;
struct AVFrame;
struct AVCodecContext;
struct AVPacket;
@@ -52,15 +51,12 @@ struct AvDeleter
void
operator()(AVCodecContext *);
void
operator()(AVFilterGraph *);
void
operator()(AVPacket *);
};
using av_buffer_ptr = std::unique_ptr<AVBufferRef, AvDeleter>;
using av_frame_ptr = std::unique_ptr<AVFrame, AvDeleter>;
using av_codec_context_ptr = std::unique_ptr<AVCodecContext, AvDeleter>;
using av_filter_graph_ptr = std::unique_ptr<AVFilterGraph, AvDeleter>;
using av_packet_ptr = std::unique_ptr<AVPacket, AvDeleter>;
av_frame_ptr
@@ -52,6 +52,8 @@ encoder(VideoEncoderFFMPEG::Codec codec)
return "h264_vaapi";
case VideoEncoderFFMPEG::Codec::h265:
return "hevc_vaapi";
case VideoEncoderFFMPEG::Codec::av1:
return "av1_vaapi";
}
throw std::runtime_error("invalid codec " + std::to_string(int(codec)));
}
@@ -192,6 +194,9 @@ video_encoder_va::video_encoder_va(wivrn_vk_bundle & vk, xrt::drivers::wivrn::en
case Codec::h265:
encoder_ctx->profile = FF_PROFILE_HEVC_MAIN;
break;
case Codec::av1:
encoder_ctx->profile = FF_PROFILE_AV1_MAIN;
break;
}
for (auto option: settings.options)
{