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

网站建设具备知识技能手机网站搜索优化

网站建设具备知识技能,手机网站搜索优化,中小企业网站建设与管理,凡科免费做网站的真的吗libaom libaom 是 AOMedia(开放媒体联盟)开发的一个开源视频编解码器库,它是 AV1 视频压缩格式的参考实现,并被广泛用于多种生产系统中。libaom 支持多种功能,包括可扩展视频编码(SVC)、实时通信…

libaom

libaom 是 AOMedia(开放媒体联盟)开发的一个开源视频编解码器库,它是 AV1 视频压缩格式的参考实现,并被广泛用于多种生产系统中。libaom 支持多种功能,包括可扩展视频编码(SVC)、实时通信(RTC)优化等,并定期进行更新以提高压缩效率和编码速度 。

libaom 的一些关键特性包括:

  1. 多空间层和时间层编码:通过 aom_svc_layer_id_t 结构体支持空间层和时间层的ID标识,允许视频在不同的分辨率和帧率下进行编码 。
  2. 编码参数配置:通过 aom_svc_params_t 结构体等配置编码参数,如空间层数量、时间层数量、量化器、缩放因子等 。
  3. 基础编码参数aom_codec_enc_cfg_t 结构体用于配置编码器的基础参数,如使用方式、时间基准、编码通道、帧重采样等 。
  4. 多遍编码模式:支持多遍编码模式,包括单遍、双遍和多遍编码,以优化编码效率和质量 。
  5. 帧超分采样:支持帧超分辨率模式,通过 rc_superres_mode 枚举值控制放大过程 。
  6. 关键帧放置:支持关键帧放置模式,通过 kf_mode 枚举值决定是否自动放置关键帧 。
  7. SVC 编码参数:支持 SVC 编码的参数类型配置,如层数量、量化器、缩放因子等 。

libaom 的更新通常每三个月进行一次,最近的更新包括对 SVC 丢帧模式的支持、新的构建配置以减小二进制文件大小、以及对 RTC 屏幕内容压缩效率的显著提升 。此外,libaom 还提供了对 AV1 视频压缩格式的支持,包括实时编码模式和对不同质量控制策略的优化 。

twopass_encoder.c 介绍

  • 功能:两遍编码循环的 demo 输入yv12 格式,输出 ivf 格式。
  • 文件位置:libaom/examples/twopass_encoder.c

函数关系

在这里插入图片描述

结构体

  1. FILE:文件结构体
  2. aom_codec_ctx_t:编解码上下文结构体
  3. aom_codec_enc_cfg_t:编码器配置结构体
  4. aom_image_t:输入图像结构体
  5. aom_codec_err_t:算法返回编码状态码结构体
  6. aom_fixed_buf_t:产生固定大小 buffer 结构体
  7. aom_codec_iface_t:编解码接口结构体
  8. AvxVideoInfo:av1 编码视频信息结构体
  9. AvxVideoWriter:视频信息写入结构体

2pass 编码原理

  1. 数据流转图在这里插入图片描述
  2. 核心原理:第一遍编码产生的aom_fixed_buf_t数据赋值给aom_codec_enc_cfg_t中的 rc_twopass_stats_in(aom_fixed_buf_t) 供第二遍编码使用;
  3. aom_fixed_buf_t 结构体:
/*!\brief Generic fixed size buffer structure** This structure is able to hold a reference to any fixed size buffer.*/
typedef struct aom_fixed_buf {void *buf;       /**< Pointer to the data. Does NOT own the data! */size_t sz;       /**< Length of the buffer, in chars */
} aom_fixed_buf_t; /**< alias for struct aom_fixed_buf */
  1. 在 pass0 函数中的get_frame_stats函数对aom_fixed_buf_t结构体进行赋值;
static int get_frame_stats(aom_codec_ctx_t *ctx, const aom_image_t *img,aom_codec_pts_t pts, unsigned int duration,aom_enc_frame_flags_t flags,aom_fixed_buf_t *stats) {int got_pkts = 0;aom_codec_iter_t iter = NULL;const aom_codec_cx_pkt_t *pkt = NULL;const aom_codec_err_t res = aom_codec_encode(ctx, img, pts, duration, flags);if (res != AOM_CODEC_OK) die_codec(ctx, "Failed to get frame stats.");while ((pkt = aom_codec_get_cx_data(ctx, &iter)) != NULL) {got_pkts = 1;if (pkt->kind == AOM_CODEC_STATS_PKT) {const uint8_t *const pkt_buf = pkt->data.twopass_stats.buf;const size_t pkt_size = pkt->data.twopass_stats.sz;stats->buf = realloc(stats->buf, stats->sz + pkt_size);if (!stats->buf) die("Failed to allocate frame stats buffer.");memcpy((uint8_t *)stats->buf + stats->sz, pkt_buf, pkt_size);stats->sz += pkt_size;}}return got_pkts;
}
  1. 在函数 set_encoder_config 中对aom_codec_enc_cfg_t中的 rc_twopass_stats_in(aom_fixed_buf_t) 进行应用;根据aom_fixed_buf_t的 sz 大小除以每个包的状态大小FIRSTPASS_STATS,作为输入配置中的 limit 变量的值;
  if (cfg->g_pass >= AOM_RC_SECOND_PASS) {const size_t packet_sz = sizeof(FIRSTPASS_STATS);const int n_packets = (int)(cfg->rc_twopass_stats_in.sz / packet_sz);input_cfg->limit = n_packets - 1;} else {input_cfg->limit = cfg->g_limit;}
  1. 在 validate_config 函数中对FIRSTPASS_STATS进行赋值,用来访问第一遍编码的统计信息。
if (cfg->g_pass >= AOM_RC_SECOND_PASS) {const size_t packet_sz = sizeof(FIRSTPASS_STATS);const int n_packets = (int)(cfg->rc_twopass_stats_in.sz / packet_sz);const FIRSTPASS_STATS *stats;if (cfg->rc_twopass_stats_in.buf == NULL)ERROR("rc_twopass_stats_in.buf not set.");if (cfg->rc_twopass_stats_in.sz % packet_sz)ERROR("rc_twopass_stats_in.sz indicates truncated packet.");if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz)ERROR("rc_twopass_stats_in requires at least two packets.");stats =(const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + n_packets - 1;if ((int)(stats->count + 0.5) != n_packets - 1)ERROR("rc_twopass_stats_in missing EOS stats packet");}
  1. FIRSTPASS_STATS的定义如下,这个结构体用于在视频编码的第一遍(分析遍)中累积帧统计信息。这些统计数据有助于在第二遍(编码遍)中优化码率分配和提高编码质量,该结构体包含了帧、权重、mv 相关、帧编码信息等等变量。
/*!* \brief The stucture of acummulated frame stats in the first pass.** Errors (coded_error, intra_error, etc.) and counters (new_mv_count) are* normalized to each MB. MV related stats (MVc, MVr, etc.) are normalized to* the frame width and height. See function normalize_firstpass_stats.*/
typedef struct FIRSTPASS_STATS {/*!* Frame number in display order, if stats are for a single frame.* No real meaning for a collection of frames.*/double frame;/*!* Weight assigned to this frame (or total weight for the collection of* frames) currently based on intra factor and brightness factor. This is used* to distribute bits betweeen easier and harder frames.*/double weight;/*!* Intra prediction error.*/double intra_error;/*!* Average wavelet energy computed using Discrete Wavelet Transform (DWT).*/double frame_avg_wavelet_energy;/*!* Best of intra pred error and inter pred error using last frame as ref.*/double coded_error;/*!* Best of intra pred error and inter pred error using golden frame as ref.*/double sr_coded_error;/*!* Percentage of blocks with inter pred error < intra pred error.*/double pcnt_inter;/*!* Percentage of blocks using (inter prediction and) non-zero motion vectors.*/double pcnt_motion;/*!* Percentage of blocks where golden frame was better than last or intra:* inter pred error using golden frame < inter pred error using last frame and* inter pred error using golden frame < intra pred error*/double pcnt_second_ref;/*!* Percentage of blocks where intra and inter prediction errors were very* close. Note that this is a 'weighted count', that is, the so blocks may be* weighted by how close the two errors were.*/double pcnt_neutral;/*!* Percentage of blocks that have almost no intra error residual* (i.e. are in effect completely flat and untextured in the intra* domain). In natural videos this is uncommon, but it is much more* common in animations, graphics and screen content, so may be used* as a signal to detect these types of content.*/double intra_skip_pct;/*!* Image mask rows top and bottom.*/double inactive_zone_rows;/*!* Image mask columns at left and right edges.*/double inactive_zone_cols;/*!* Average of row motion vectors.*/double MVr;/*!* Mean of absolute value of row motion vectors.*/double mvr_abs;/*!* Mean of column motion vectors.*/double MVc;/*!* Mean of absolute value of column motion vectors.*/double mvc_abs;/*!* Variance of row motion vectors.*/double MVrv;/*!* Variance of column motion vectors.*/double MVcv;/*!* Value in range [-1,1] indicating fraction of row and column motion vectors* that point inwards (negative MV value) or outwards (positive MV value).* For example, value of 1 indicates, all row/column MVs are inwards.*/double mv_in_out_count;/*!* Count of unique non-zero motion vectors.*/double new_mv_count;/*!* Duration of the frame / collection of frames.*/double duration;/*!* 1.0 if stats are for a single frame, OR* Number of frames in this collection for which the stats are accumulated.*/double count;/*!* standard deviation for (0, 0) motion prediction error*/double raw_error_stdev;/*!* Whether the frame contains a flash*/int64_t is_flash;/*!* Estimated noise variance*/double noise_var;/*!* Correlation coefficient with the previous frame*/double cor_coeff;/*!* log of intra_error*/double log_intra_error;/*!* log of coded_error*/double log_coded_error;
} FIRSTPASS_STATS;
http://www.hkea.cn/news/330029/

相关文章:

  • 深圳做网站推广哪家好青岛关键词优化平台
  • 呼和浩特市网站建设公司uc搜索引擎入口
  • 网站怎么做关键词搜索电子商务主要学什么内容
  • python做的网站漏洞百度竞价推广开户联系方式
  • 做任务换流量的网站怎么自己制作网页
  • 福清建设局网站火蝠电商代运营公司
  • 爱玖货源站在线智能识图
  • 上海网络营销软件windows优化大师win10
  • 专做美妆的视频网站ui设计
  • 平度市建设局网站济宁百度推广价格
  • 茶类网站建设方案西安网站seo排名优化
  • 南和县住房和建设局网站石家庄整站优化技术
  • 做教育网站销售的好吗成都百度网站排名优化
  • 展览展会网页模板下载河南网站优化排名
  • 自己做网站上传视频疫情二十条优化措施
  • 网站排名上升 优帮云网络销售培训学校
  • 对于政务网站建设的建议网站收录优化
  • 网站策划与建设阶段的推广方法网络软文怎么写
  • 漳州公司做网站重庆网站建设
  • 十大网络平台有哪些网站关键词排名seo
  • 建b2c网站google官方下载安装
  • 广州b2b网站建设公司推广网站
  • 新乡市封丘县建设局网站百度教育官网登录入口
  • 网站开发项目点击器
  • 建公司网站需要多少钱推广普通话手抄报内容资料
  • 东莞市建设监督网站首页app宣传推广方案
  • 网站设计基本功能域名免费注册0元注册
  • 徐州网站建设的特点营销咨询公司
  • 网站建设问题表在seo优化中
  • 网站建设公司 倒闭店铺推广方法