x264 码率控制原理:rate_estimate_qscale 函数

rate_estimate_qscale 函数

原理

  1. 函数功能:根据目前使用的实际比特数更新一帧的qscale;是一个复杂的决策过程,需要考虑多种因素,如帧类型、编码的复杂度、目标比特率、缓冲区大小等,以确保视频质量和文件大小之间的平衡。
  2. 函数参数分析
  • x264_t *h :编码器上下文信息结构体
  1. 函数调用关系
    在这里插入图片描述
  2. 函数内部执行过程
  • 初始化码控状态:变量 q用来存储计算出来的量化参数,取指向当前编码器实例的码率控制配置的指针rcc;初始化一个ratecontrol_entry_t结构体rce,指向编码过程中码率控制的各种信息,这个结构体在 2pass 码控中特别有用,用于收集相关信息;确定当前帧类型pict_type;
  • 计算到目前为止使用的总比特:h->stat.i_frame_size数组存储了不同类型帧的大小,乘以8是因为每个字节有8位。然后从这个总和中减去填充比特的总数(rcc->filler_bits_sum),得到实际使用的总
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
int main(int argc, const char** argv) { //****************************************获取数据***************************************************** const std::string input_filename = (argc > 1) ? argv[1] : CGAL::data_file_path("C:\\Users\\lwc\\source\\repos\\Project4\\x64\\Release\\output.xyz"); const char* output_filename = (argc > 2) ? argv[2] : "C:\\Users\\lwc\\source\\repos\\Project4\\x64\\Release\\113.xyz"; //输出文件名称 std::vector<PointVectorPair> points; if (!CGAL::IO::read_points(input_filename, std::back_inserter(points), CGAL::parameters::point_map(CGAL::First_of_pair_property_map<PointVectorPair>()) .normal_map(CGAL::Second_of_pair_property_map<PointVectorPair>()))) { std::cerr << "Error: cannot read file " << input_filename << std::endl; return EXIT_FAILURE; } //****************************************点云平滑************************************************* unsigned int k = 5; //邻近点数 double offset_radius = 0.01; CGAL::vcm_estimate_normals<std::vector<PointVectorPair>>(points, offset_radius, k, CGAL::parameters::point_map(CGAL::First_of_pair_property_map<PointVectorPair>()) .normal_map(CGAL::Second_of_pair_property_map<PointVectorPair>())); //使用vcm算法来获取每个点的法向量,后面的参数指定了我们的点与法向量对于的部分 //********************************************保存数据************************************************* if (!CGAL::IO::write_points(output_filename, points, CGAL::parameters::point_map(CGAL::First_of_pair_property_map<PointVectorPair>()) .normal_map(CGAL::Second_of_pair_property_map<PointVectorPair>()) .stream_precision(17))) return EXIT_FAILURE; std::cout << "计算结束!" << std::endl; return EXIT_SUCCESS; } 我想将此算法改成遍历文件夹应该怎么写
07-20

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Codec Conductor

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值