当前位置: 首页 > news >正文

FFmpeg之HWContextType

HWContextType算是ffmpeg中为硬解码第三方接口的一个辅助类,它自己有两个辅助子类
AVHWDeviceContext和AVHWFramesContext。
AVHWDeviceContext主要表示硬件上下文
AVHWFramesContext主要表示硬件Frame的一些参数,比如你解码后的YUV数据还在硬件上,那么就通过这个类去存储相关参数。

那么它辅助硬解码器做什么呢?我们还是通过英伟达的例子来看

const HWContextType ff_hwcontext_type_cuda = {.type                 = AV_HWDEVICE_TYPE_CUDA,.name                 = "CUDA",.device_hwctx_size    = sizeof(AVCUDADeviceContext),.frames_priv_size     = sizeof(CUDAFramesContext),.device_create        = cuda_device_create,.device_derive        = cuda_device_derive,.device_init          = cuda_device_init,.device_uninit        = cuda_device_uninit,.frames_get_constraints = cuda_frames_get_constraints,.frames_init          = cuda_frames_init,.frames_get_buffer    = cuda_get_buffer,.transfer_get_formats = cuda_transfer_get_formats,.transfer_data_to     = cuda_transfer_data,.transfer_data_from   = cuda_transfer_data,.pix_fmts             = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE },
};

仔细看上面函数就发现,全部是device mem操作,大白话说就是ffmpeg通过这套机制来实现D2H或者H2D的操作,别无其它。

具体看看结构体定义吧,一大堆函数指针,这些就是你要实现的,不一定全部要实现,实现你自己想要的就可以了,主要的有transfer_data_to/transfer_data_from,map_to/map_from。


typedef struct HWContextType {enum AVHWDeviceType type;const char         *name;/*** An array of pixel formats supported by the AVHWFramesContext instances* Terminated by AV_PIX_FMT_NONE.*/const enum AVPixelFormat *pix_fmts;/*** size of the public hardware-specific context,* i.e. AVHWDeviceContext.hwctx*/size_t             device_hwctx_size;/*** size of the private data, i.e.* AVHWDeviceInternal.priv*/size_t             device_priv_size;/*** Size of the hardware-specific device configuration.* (Used to query hwframe constraints.)*/size_t             device_hwconfig_size;/*** size of the public frame pool hardware-specific context,* i.e. AVHWFramesContext.hwctx*/size_t             frames_hwctx_size;/*** size of the private data, i.e.* AVHWFramesInternal.priv*/size_t             frames_priv_size;int              (*device_create)(AVHWDeviceContext *ctx, const char *device,AVDictionary *opts, int flags);int              (*device_derive)(AVHWDeviceContext *dst_ctx,AVHWDeviceContext *src_ctx,AVDictionary *opts, int flags);int              (*device_init)(AVHWDeviceContext *ctx);void             (*device_uninit)(AVHWDeviceContext *ctx);int              (*frames_get_constraints)(AVHWDeviceContext *ctx,const void *hwconfig,AVHWFramesConstraints *constraints);int              (*frames_init)(AVHWFramesContext *ctx);void             (*frames_uninit)(AVHWFramesContext *ctx);int              (*frames_get_buffer)(AVHWFramesContext *ctx, AVFrame *frame);int              (*transfer_get_formats)(AVHWFramesContext *ctx,enum AVHWFrameTransferDirection dir,enum AVPixelFormat **formats);int              (*transfer_data_to)(AVHWFramesContext *ctx, AVFrame *dst,const AVFrame *src);int              (*transfer_data_from)(AVHWFramesContext *ctx, AVFrame *dst,const AVFrame *src);int              (*map_to)(AVHWFramesContext *ctx, AVFrame *dst,const AVFrame *src, int flags);int              (*map_from)(AVHWFramesContext *ctx, AVFrame *dst,const AVFrame *src, int flags);int              (*frames_derive_to)(AVHWFramesContext *dst_ctx,AVHWFramesContext *src_ctx, int flags);int              (*frames_derive_from)(AVHWFramesContext *dst_ctx,AVHWFramesContext *src_ctx, int flags);
} HWContextType;

AVHWFramesContext结构体表示


/*** This struct describes a set or pool of "hardware" frames (i.e. those with* data not located in normal system memory). All the frames in the pool are* assumed to be allocated in the same way and interchangeable.** This struct is reference-counted with the AVBuffer mechanism and tied to a* given AVHWDeviceContext instance. The av_hwframe_ctx_alloc() constructor* yields a reference, whose data field points to the actual AVHWFramesContext* struct.*/
typedef struct AVHWFramesContext {/*** A class for logging.*/const AVClass *av_class;/*** Private data used internally by libavutil. Must not be accessed in any* way by the caller.*/AVHWFramesInternal *internal;/*** A reference to the parent AVHWDeviceContext. This reference is owned and* managed by the enclosing AVHWFramesContext, but the caller may derive* additional references from it.*/AVBufferRef *device_ref;/*** The parent AVHWDeviceContext. This is simply a pointer to* device_ref->data provided for convenience.** Set by libavutil in av_hwframe_ctx_init().*/AVHWDeviceContext *device_ctx;/*** The format-specific data, allocated and freed automatically along with* this context.** Should be cast by the user to the format-specific context defined in the* corresponding header (hwframe_*.h) and filled as described in the* documentation before calling av_hwframe_ctx_init().** After any frames using this context are created, the contents of this* struct should not be modified by the caller.*/void *hwctx;/*** This field may be set by the caller before calling av_hwframe_ctx_init().** If non-NULL, this callback will be called when the last reference to* this context is unreferenced, immediately before it is freed.*/void (*free)(struct AVHWFramesContext *ctx);/*** Arbitrary user data, to be used e.g. by the free() callback.*/void *user_opaque;/*** A pool from which the frames are allocated by av_hwframe_get_buffer().* This field may be set by the caller before calling av_hwframe_ctx_init().* The buffers returned by calling av_buffer_pool_get() on this pool must* have the properties described in the documentation in the corresponding hw* type's header (hwcontext_*.h). The pool will be freed strictly before* this struct's free() callback is invoked.** This field may be NULL, then libavutil will attempt to allocate a pool* internally. Note that certain device types enforce pools allocated at* fixed size (frame count), which cannot be extended dynamically. In such a* case, initial_pool_size must be set appropriately.*/AVBufferPool *pool;/*** Initial size of the frame pool. If a device type does not support* dynamically resizing the pool, then this is also the maximum pool size.** May be set by the caller before calling av_hwframe_ctx_init(). Must be* set if pool is NULL and the device type does not support dynamic pools.*/int initial_pool_size;/*** The pixel format identifying the underlying HW surface type.** Must be a hwaccel format, i.e. the corresponding descriptor must have the* AV_PIX_FMT_FLAG_HWACCEL flag set.** Must be set by the user before calling av_hwframe_ctx_init().*/enum AVPixelFormat format;/*** The pixel format identifying the actual data layout of the hardware* frames.** Must be set by the caller before calling av_hwframe_ctx_init().** @note when the underlying API does not provide the exact data layout, but* only the colorspace/bit depth, this field should be set to the fully* planar version of that format (e.g. for 8-bit 420 YUV it should be* AV_PIX_FMT_YUV420P, not AV_PIX_FMT_NV12 or anything else).*/enum AVPixelFormat sw_format;/*** The allocated dimensions of the frames in this pool.** Must be set by the user before calling av_hwframe_ctx_init().*/int width, height;
} AVHWFramesContext;

AVHWDeviceContext的结构体表示,硬件的抽象


/*** This struct aggregates all the (hardware/vendor-specific) "high-level" state,* i.e. state that is not tied to a concrete processing configuration.* E.g., in an API that supports hardware-accelerated encoding and decoding,* this struct will (if possible) wrap the state that is common to both encoding* and decoding and from which specific instances of encoders or decoders can be* derived.** This struct is reference-counted with the AVBuffer mechanism. The* av_hwdevice_ctx_alloc() constructor yields a reference, whose data field* points to the actual AVHWDeviceContext. Further objects derived from* AVHWDeviceContext (such as AVHWFramesContext, describing a frame pool with* specific properties) will hold an internal reference to it. After all the* references are released, the AVHWDeviceContext itself will be freed,* optionally invoking a user-specified callback for uninitializing the hardware* state.*/
typedef struct AVHWDeviceContext {/*** A class for logging. Set by av_hwdevice_ctx_alloc().*/const AVClass *av_class;/*** Private data used internally by libavutil. Must not be accessed in any* way by the caller.*/AVHWDeviceInternal *internal;/*** This field identifies the underlying API used for hardware access.** This field is set when this struct is allocated and never changed* afterwards.*/enum AVHWDeviceType type;/*** The format-specific data, allocated and freed by libavutil along with* this context.** Should be cast by the user to the format-specific context defined in the* corresponding header (hwcontext_*.h) and filled as described in the* documentation before calling av_hwdevice_ctx_init().** After calling av_hwdevice_ctx_init() this struct should not be modified* by the caller.*/void *hwctx;/*** This field may be set by the caller before calling av_hwdevice_ctx_init().** If non-NULL, this callback will be called when the last reference to* this context is unreferenced, immediately before it is freed.** @note when other objects (e.g an AVHWFramesContext) are derived from this*       struct, this callback will be invoked after all such child objects*       are fully uninitialized and their respective destructors invoked.*/void (*free)(struct AVHWDeviceContext *ctx);/*** Arbitrary user data, to be used e.g. by the free() callback.*/void *user_opaque;
} AVHWDeviceContext;

常用函数

这些函数其实挺重要的,因为都是用户函数,通过这些函数去从解码器硬件上获取到你要的数据,比如av_hwframe_transfer_data/av_hwframe_get_buffer,就是说你在ffmpeg中不要显示的调用你自己的cuMemD2H或者H2D的函数,ffmpeg已经给你预留好了接口了,用这些接口去获取更加简单。


/*** Look up an AVHWDeviceType by name.** @param name String name of the device type (case-insensitive).* @return The type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if*         not found.*/
enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name);/** Get the string name of an AVHWDeviceType.** @param type Type from enum AVHWDeviceType.* @return Pointer to a static string containing the name, or NULL if the type*         is not valid.*/
const char *av_hwdevice_get_type_name(enum AVHWDeviceType type);/*** Iterate over supported device types.** @param type AV_HWDEVICE_TYPE_NONE initially, then the previous type*             returned by this function in subsequent iterations.* @return The next usable device type from enum AVHWDeviceType, or*         AV_HWDEVICE_TYPE_NONE if there are no more.*/
enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev);/*** Allocate an AVHWDeviceContext for a given hardware type.** @param type the type of the hardware device to allocate.* @return a reference to the newly created AVHWDeviceContext on success or NULL*         on failure.*/
AVBufferRef *av_hwdevice_ctx_alloc(enum AVHWDeviceType type);/*** Finalize the device context before use. This function must be called after* the context is filled with all the required information and before it is* used in any way.** @param ref a reference to the AVHWDeviceContext* @return 0 on success, a negative AVERROR code on failure*/
int av_hwdevice_ctx_init(AVBufferRef *ref);/*** Open a device of the specified type and create an AVHWDeviceContext for it.** This is a convenience function intended to cover the simple cases. Callers* who need to fine-tune device creation/management should open the device* manually and then wrap it in an AVHWDeviceContext using* av_hwdevice_ctx_alloc()/av_hwdevice_ctx_init().** The returned context is already initialized and ready for use, the caller* should not call av_hwdevice_ctx_init() on it. The user_opaque/free fields of* the created AVHWDeviceContext are set by this function and should not be* touched by the caller.** @param device_ctx On success, a reference to the newly-created device context*                   will be written here. The reference is owned by the caller*                   and must be released with av_buffer_unref() when no longer*                   needed. On failure, NULL will be written to this pointer.* @param type The type of the device to create.* @param device A type-specific string identifying the device to open.* @param opts A dictionary of additional (type-specific) options to use in*             opening the device. The dictionary remains owned by the caller.* @param flags currently unused** @return 0 on success, a negative AVERROR code on failure.*/
int av_hwdevice_ctx_create(AVBufferRef **device_ctx, enum AVHWDeviceType type,const char *device, AVDictionary *opts, int flags);/*** Create a new device of the specified type from an existing device.** If the source device is a device of the target type or was originally* derived from such a device (possibly through one or more intermediate* devices of other types), then this will return a reference to the* existing device of the same type as is requested.** Otherwise, it will attempt to derive a new device from the given source* device.  If direct derivation to the new type is not implemented, it will* attempt the same derivation from each ancestor of the source device in* turn looking for an implemented derivation method.** @param dst_ctx On success, a reference to the newly-created*                AVHWDeviceContext.* @param type    The type of the new device to create.* @param src_ctx A reference to an existing AVHWDeviceContext which will be*                used to create the new device.* @param flags   Currently unused; should be set to zero.* @return        Zero on success, a negative AVERROR code on failure.*/
int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ctx,enum AVHWDeviceType type,AVBufferRef *src_ctx, int flags);/*** Create a new device of the specified type from an existing device.** This function performs the same action as av_hwdevice_ctx_create_derived,* however, it is able to set options for the new device to be derived.** @param dst_ctx On success, a reference to the newly-created*                AVHWDeviceContext.* @param type    The type of the new device to create.* @param src_ctx A reference to an existing AVHWDeviceContext which will be*                used to create the new device.* @param options Options for the new device to create, same format as in*                av_hwdevice_ctx_create.* @param flags   Currently unused; should be set to zero.* @return        Zero on success, a negative AVERROR code on failure.*/
int av_hwdevice_ctx_create_derived_opts(AVBufferRef **dst_ctx,enum AVHWDeviceType type,AVBufferRef *src_ctx,AVDictionary *options, int flags);/*** Allocate an AVHWFramesContext tied to a given device context.** @param device_ctx a reference to a AVHWDeviceContext. This function will make*                   a new reference for internal use, the one passed to the*                   function remains owned by the caller.* @return a reference to the newly created AVHWFramesContext on success or NULL*         on failure.*/
AVBufferRef *av_hwframe_ctx_alloc(AVBufferRef *device_ctx);/*** Finalize the context before use. This function must be called after the* context is filled with all the required information and before it is attached* to any frames.** @param ref a reference to the AVHWFramesContext* @return 0 on success, a negative AVERROR code on failure*/
int av_hwframe_ctx_init(AVBufferRef *ref);/*** Allocate a new frame attached to the given AVHWFramesContext.** @param hwframe_ctx a reference to an AVHWFramesContext* @param frame an empty (freshly allocated or unreffed) frame to be filled with*              newly allocated buffers.* @param flags currently unused, should be set to zero* @return 0 on success, a negative AVERROR code on failure*/
int av_hwframe_get_buffer(AVBufferRef *hwframe_ctx, AVFrame *frame, int flags);/*** Copy data to or from a hw surface. At least one of dst/src must have an* AVHWFramesContext attached.** If src has an AVHWFramesContext attached, then the format of dst (if set)* must use one of the formats returned by av_hwframe_transfer_get_formats(src,* AV_HWFRAME_TRANSFER_DIRECTION_FROM).* If dst has an AVHWFramesContext attached, then the format of src must use one* of the formats returned by av_hwframe_transfer_get_formats(dst,* AV_HWFRAME_TRANSFER_DIRECTION_TO)** dst may be "clean" (i.e. with data/buf pointers unset), in which case the* data buffers will be allocated by this function using av_frame_get_buffer().* If dst->format is set, then this format will be used, otherwise (when* dst->format is AV_PIX_FMT_NONE) the first acceptable format will be chosen.** The two frames must have matching allocated dimensions (i.e. equal to* AVHWFramesContext.width/height), since not all device types support* transferring a sub-rectangle of the whole surface. The display dimensions* (i.e. AVFrame.width/height) may be smaller than the allocated dimensions, but* also have to be equal for both frames. When the display dimensions are* smaller than the allocated dimensions, the content of the padding in the* destination frame is unspecified.** @param dst the destination frame. dst is not touched on failure.* @param src the source frame.* @param flags currently unused, should be set to zero* @return 0 on success, a negative AVERROR error code on failure.*/
int av_hwframe_transfer_data(AVFrame *dst, const AVFrame *src, int flags);enum AVHWFrameTransferDirection {/*** Transfer the data from the queried hw frame.*/AV_HWFRAME_TRANSFER_DIRECTION_FROM,/*** Transfer the data to the queried hw frame.*/AV_HWFRAME_TRANSFER_DIRECTION_TO,
};/*** Get a list of possible source or target formats usable in* av_hwframe_transfer_data().** @param hwframe_ctx the frame context to obtain the information for* @param dir the direction of the transfer* @param formats the pointer to the output format list will be written here.*                The list is terminated with AV_PIX_FMT_NONE and must be freed*                by the caller when no longer needed using av_free().*                If this function returns successfully, the format list will*                have at least one item (not counting the terminator).*                On failure, the contents of this pointer are unspecified.* @param flags currently unused, should be set to zero* @return 0 on success, a negative AVERROR code on failure.*/
int av_hwframe_transfer_get_formats(AVBufferRef *hwframe_ctx,enum AVHWFrameTransferDirection dir,enum AVPixelFormat **formats, int flags);

相关文章:

FFmpeg之HWContextType

HWContextType算是ffmpeg中为硬解码第三方接口的一个辅助类,它自己有两个辅助子类 AVHWDeviceContext和AVHWFramesContext。 AVHWDeviceContext主要表示硬件上下文 AVHWFramesContext主要表示硬件Frame的一些参数,比如你解码后的YUV数据还在硬件上&#…...

Python面向对象之类和对象(Python系列16)

前言:面向对象是什么,为什么要学面向对象?面向对象是一种思想,让我们的程序变得更加的贴切我们的生活,更加的形象,让代码的可读性和扩展性变得更高。 面向对象:可以使用类将变量和函数组成新的…...

电商对传统零售业的影响:销售渠道、价格竞争与服务质量挑战

随着互联网的普及和电商行业的飞速发展,传统零售业面临着前所未有的挑战。电商不仅改变了消费者的购物方式和消费习惯,还对传统零售业的销售渠道、价格竞争和服务质量等方面产生了深远的影响。本文将详细分析电商对传统零售业的影响,以期为传…...

DENet:用于可见水印去除的Disentangled Embedding网络笔记

1 Title DENet: Disentangled Embedding Network for Visible Watermark Removal(Ruizhou Sun、Yukun Su、Qingyao Wu)[AAAI2023 Oral] 2 Conclusion This paper propose a novel contrastive learning mechanism to disentangle the high-level embedd…...

C++初阶(十五)Stack和Queue

文章目录 一、Stack的模拟实现二、Queue的模拟实现三、容器适配器1、什么是容器适配器2、STL标准库中stack和queue的底层结构3、 deque的简单介绍(了解)1、deque的原理介绍2、deque的缺陷 4、为什么选择deque作为stack和queue的底层默认容器 一、Stack的模拟实现 #include<…...

C#面试题

基本概念 装箱和拆箱 装箱的过程&#xff0c;是将 值类型 转换为 引用类型 的过程&#xff1b; 拆箱则是将引用类型转换为值类型。 int val 100; object obj val; //装箱 int num (int) obj; //拆箱 委托(delegate) 委托&#xff08;Delegate&#xff09; 是存有对某个…...

python源码,在线读取传奇列表,并解析为需要的JSON格式

python源码&#xff0c;在线读取传奇列表&#xff0c;并解析为需要的JSON格式 [Server] ; 使用“/”字符分开颜色&#xff0c;也可以不使用颜色&#xff0c;支持以前的旧格式&#xff0c;只有标题和服务器标题支持颜色 ; 标题/颜色代码(0-255)|服务器标题/颜色代码(0-255)|服务…...

二叉排序树的判断(二叉树的顺序存储):2022年408算法题

对于采用顺序存储方式保存的二叉树&#xff0c;根结点保存在SqBiTNode[0]中&#xff1b;当某结点保存SqBiTNode[i]中时&#xff0c;若有左孩子&#xff0c;则其值保存在SqBiTNode [2i1]中&#xff1b;若有右孩子&#xff0c;则其值保存在SqBiTNode[2i2]中&#xff1b;若有双亲结…...

Kubernetes版本升级到v1.18.0方法

升级k8s版本才能使用kube-prometheus安装监控 1、查看集群状态 [rootk8s-master k8s-script]# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master Ready master 5d22h v1.18.0 k8s-slave1 Ready <none> 4d10h v1.18.0 k…...

了解 git rebase

了解 git rebase 大多数人习惯使用 git merge 将更改从功能分支合并到主分支&#xff0c;但还有其他方法。我们是否曾经遇到过 git rebase 这个术语并想知道它是什么&#xff1f;或者我们可能听说过 rebase 和 merge &#xff0c;但不确定何时使用哪个&#xff1f;不用担心&am…...

程序员的养生之道:延寿健康的十大秘诀(下)

程序员的养生之道&#xff1a;延寿健康的十大秘诀&#xff08;上&#xff09;-CSDN博客 目录 6. 心理调节&#xff0c;减轻压力 6.1 程序员常见的心理问题 6.2 压力管理的重要性 6.3 放松技巧与应对策略 6.4 积极心态与心理健康 7. 正确坐姿&#xff0c;保护颈椎腰椎 …...

【java】保留前N月数据文件,定期删除数据

数据越积越多&#xff0c;过于冗余&#xff1b;数据库定期删除指定时间前的数据&#xff1b;文件生成的删除指定时间前端文件 SFTP文件定期删除 java sftp 定时清理指定文件中固定时间 依赖 <!-- ftp文件上传/下载Jar包 --> <dependency><groupId>com.jc…...

12.9_黑马数据结构与算法笔记Java

目录 057 多路递归 e03 杨辉三角2 thinking&#xff1a;二维数组的动态初始化&#xff1f; 057 多路递归 e03 杨辉三角3 058 链表 e01 反转单向链表1 058 链表 e01 反转单向链表2 058 链表 e01 反转单向链表3 递归 058 链表 e01 反转单向链表4 为什么是returnn1呢&…...

K8S学习指南(1)-docker的安装

文章目录 引言1. Windows 系统中安装 Dockera. 确认系统要求b. 下载 Docker Desktopc. 安装 Docker Desktopd. 配置 Docker Desktope. 验证安装 2. Ubuntu 系统中安装 Dockera. 更新包列表b. 安装依赖包c. 添加 Docker GPG 密钥d. 添加 Docker APT 仓库e. 安装 Dockerf. 添加用…...

vue3 + mark.js 实现文字标注功能

效果图 安装依赖 npm install mark.js --save-dev npm i nanoid代码块 <template><!-- 文档标注 --><header><el-buttontype"primary":disabled"selectedTextList.length 0 ? true : false"ghostclick"handleAllDelete"…...

运筹优化 | 模拟退火求解旅行商问题 | Python实现

"""模拟退火旅行商""" import random import numpy as np import math import time import matplotlib.pyplot as plt plt.rcParams[font.sans-serif] [SimHei] plt.rcParams[axes.unicode_minus] False location np.loadtxt(city_location.t…...

1017 A除以B

本题要求计算 A/B&#xff0c;其中 A 是不超过 1000 位的正整数&#xff0c;B 是 1 位正整数。你需要输出商数 Q 和余数 R&#xff0c;使得 ABQR 成立。 输入格式&#xff1a; 输入在一行中依次给出 A 和 B&#xff0c;中间以 1 空格分隔。 输出格式&#xff1a; 在一行中依…...

SAP UI5 walkthrough step8 Translatable Texts

在这个章节&#xff0c;我们会将一些文本常量独立出一个资源文件 这样的话&#xff0c;可以方便这些文本常量被翻译成任意的语言 这种国际化的操作&#xff0c;我们一般命名为i18n 新建一个文件i18n.properties webapp/i18n/i18n.properties (New) showHelloButtonTextSay …...

RocketMQ-源码架构二

梳理一些比较完整&#xff0c;比较复杂的业务线 消息持久化设计 RocketMQ的持久化文件结构 消息持久化也就是将内存中的消息写入到本地磁盘的过程。而磁盘IO操作通常是一个很耗性能&#xff0c;很慢的操作&#xff0c;所以&#xff0c;对消息持久化机制的设计&#xff0c;是…...

Unity_ET框架项目-斗地主_启动运行流程

unity_ET框架项目-斗地主_启动运行流程 项目源码地址&#xff1a; Viagi/LandlordsCore: ET斗地主Demohttps://github.com/Viagi/LandlordsCore下载项目到本地。 启动运行步骤&#xff1a; 下载目录如下&#xff1a; 1. VS&#xff08;我用是2022版VisualStudio&#xff09…...

优化粒子群算法实现VMD分解参数优化

56_基于改进的粒子群算法实现vmd分解参数优化。 matlab环境&#xff0c;2018a及以上版本。 可用于学习粒子群算法的改进&#xff0c;以及粒子群算法的使用。 1.考虑到传统粒子群算法中固定的权值容易使算法陷入局部最优解&#xff0c;针对这一缺点&#xff0c;从惯性权重和学习…...

ESP32 -espidf 实战:利用AW9523实现16路PWM调光与高电流驱动

1. 为什么需要AW9523扩展芯片&#xff1f; ESP32作为一款功能强大的物联网芯片&#xff0c;其GPIO资源在实际项目中经常捉襟见肘。做过智能照明项目的朋友应该深有体会&#xff0c;当我们需要控制多个LED灯带时&#xff0c;ESP32自带的PWM通道根本不够用。我曾经在一个商业照明…...

Radiant Player媒体键集成:揭秘硬件控制背后的技术

Radiant Player媒体键集成&#xff1a;揭秘硬件控制背后的技术 【免费下载链接】radiant-player-mac :notes: Turn Google Play Music into a separate, beautiful application that integrates with your Mac. 项目地址: https://gitcode.com/gh_mirrors/ra/radiant-player-…...

STM32F407硬件COM事件实战:六步换相避坑指南(附CubeMX配置)

STM32F407硬件COM事件六步换相实战&#xff1a;从CubeMX配置到避坑指南 在无刷电机控制领域&#xff0c;六步换相是最基础也最关键的环节之一。传统软件换相方式存在PWM通道更新不同步的痛点&#xff0c;而STM32F407的硬件COM事件功能恰好能完美解决这个问题。本文将带您深入实…...

通信萌新们注意了!今天咱们玩点刺激的——用MATLAB手搓各种QAM调制的性能对比。准备好你的小本本,咱们边写代码边分析,包教包会

基于4QAM&#xff0c;16QAM&#xff0c;64QAM调制方式下经过AWGN信道的性能分析 均包含加噪声前后的星座图、误码率和误符号率性能对比&#xff0c;该程序一共10张仿真图&#xff0c;可学习性非常强先上硬货&#xff0c;看看怎么生成4QAM的星座图。掏出这段代码&#xff1a; M …...

直接上代码吧,咱们先用Python+OpenCV搞个帧间差法的Demo。看这段核心代码

基于帧间差法进行视频目标检测处理 【是仅源码的价格】 【可写完整课程设计文档报告】 需要或需要请随时联系&#xff0c;博主常在线能秒回 1.[1]视频目标检测&#xff1a; 视频目标检测是指从视频流中自动识别和提取出运动目标的过程 视频目标检测算法通常基于以下原理和方法&…...

关于sms,voip路由以及smpp

SMS 和 VoIP 路由是国际通讯行业核心技术&#xff0c;用于高效传递短信和语音通话。SMPP 协议则是 SMS 传输的关键标准&#xff0c;帮助运营商和企业实现全球消息互联。SMS 基础知识SMS&#xff08;Short Message Service&#xff0c;短消息服务&#xff09;是手机最常见的文本…...

如何用CodeMaker将Java/Scala开发效率提升300%?5个核心技巧带你掌握智能代码生成

如何用CodeMaker将Java/Scala开发效率提升300%&#xff1f;5个核心技巧带你掌握智能代码生成 【免费下载链接】CodeMaker A idea-plugin for Java/Scala, support custom code template. 项目地址: https://gitcode.com/gh_mirrors/co/CodeMaker 作为Java/Scala开发者&a…...

课灵h5p-标签页 (Tabs)教程

标签页 (Tabs)教程 标签页 (Tabs) 是一种高效的内容容器&#xff0c;通过水平切换的选项卡界面来组织信息。它允许你在同一页面空间内并行展示多个同层级的主题&#xff08;如不同类别的资源、不同语言的版本&#xff09;&#xff0c;帮助学习者按需浏览&#xff0c;保持界面整…...

Win10自带应用太多?3分钟教你用PowerShell精准卸载(附常用应用命令大全)

Win10系统精简指南&#xff1a;PowerShell精准卸载内置应用全攻略 每次打开开始菜单&#xff0c;那些从未使用过的内置应用图标是否让您感到烦躁&#xff1f;作为技术从业者&#xff0c;我们更希望拥有一个干净高效的工作环境。本文将带您深入探索PowerShell在Windows系统管理中…...