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

webrtc支持的最小宽度和高度

代码在:h264/sps_parser.cc

//
// IMPORTANT ONES! Now we're getting to resolution. First we read the pic
// width/height in macroblocks (16x16), which gives us the base resolution,
// and then we continue on until we hit the frame crop offsets, which are used
// to signify resolutions that aren't multiples of 16.
//
// pic_width_in_mbs_minus1: ue(v)
sps.width = 16 * (reader.ReadExponentialGolomb() + 1);
// Figure out the crop units in pixels. That's based on the chroma format's
// sampling, which is indicated by chroma_format_idc.
if (sps.separate_colour_plane_flag || chroma_format_idc == 0) {frame_crop_bottom_offset *= (2 - sps.frame_mbs_only_flag);frame_crop_top_offset *= (2 - sps.frame_mbs_only_flag);
} else if (!sps.separate_colour_plane_flag && chroma_format_idc > 0) {// Width multipliers for formats 1 (4:2:0) and 2 (4:2:2).if (chroma_format_idc == 1 || chroma_format_idc == 2) {frame_crop_left_offset *= 2;frame_crop_right_offset *= 2;}// Height multipliers for format 1 (4:2:0).if (chroma_format_idc == 1) {frame_crop_top_offset *= 2;frame_crop_bottom_offset *= 2;}
}
// Subtract the crop for each dimension.
sps.width -= (frame_crop_left_offset + frame_crop_right_offset);
sps.height -= (frame_crop_top_offset + frame_crop_bottom_offset);

读取图像的宽度和高度,以宏块(16x16)为单位,这给出了基本分辨率。然后,继续读取直到遇到帧裁剪偏移量,这些偏移量用于表示不是16的倍数的分辨率。

在这段代码中,“pic_width_in_mbs_minus1” 是一个无符号指数哥伦布编码(ue(v)),用于计算图像的宽度。最后一行代码则将图像的宽度设置为16乘以读取的值加1。

根据色度格式和色度平面标志来调整帧的裁剪偏移量,然后根据计算得到的偏移量来调整图像的宽度和高度,以实现正确的裁剪。

即支持16x16的块,然后按2的倍数做裁减。

http://www.lryc.cn/news/265891.html

相关文章:

  • 虚拟机对象的创建
  • 阿里云吴结生:云计算是企业实现数智化的阶梯
  • MySQL——复合查询
  • mysql 23-3day 数据库授权(DCL)
  • OpenHarmony之内核层解析~
  • Chatgpt如何共享可以防止封号!
  • 智能优化算法应用:基于社交网络算法3D无线传感器网络(WSN)覆盖优化 - 附代码
  • thinkphp+vue+mysql酒店客房管理系统 b1g8z
  • nodejs+vue+ElementUi摄影作品图片分享工作室管理系统
  • 详解FreeRTOS:专栏总述
  • 在 linux 服务器上安装Redis数据库
  • 阿里云经济型、通用算力型、计算型、通用型、内存型云服务器最新活动报价
  • 回溯算法 典型习题
  • 14. 从零用Rust编写正反向代理, HTTP文件服务器的实现过程及参数
  • 【随笔】MD5加密字符串、文件apache、springframework实现
  • java八股 设计模式
  • Docker安装(CentOS)+简单使用
  • Mybatis配置-环境配置(environments)
  • Android模拟器的安装和adb连接
  • 引领创新潮流,武汉灰京文化开创游戏行业新推广标杆
  • HTML5文档
  • springboot实现发送邮件开箱即用
  • 论文阅读——RS DINO
  • 【即插即用篇】YOLOv8改进实战 | 引入 Involution(内卷),用于视觉识别的新一代神经网络!涨点神器!
  • 在Excel中,如何简单快速地删除重复项,这里提供详细步骤
  • 【Kafka-Eagle】EFAK告警配置与实践
  • 机器学习 | 概率图模型
  • 25、新加坡南洋理工、新加坡国立大学提出FBCNet:完美融合FBCSP的CNN,EEG解码SOTA水准![抱歉老师,我太想进步了!]
  • 单调栈分类、封装和总结
  • 【Amazon 实验①】使用 Amazon CloudFront加速Web内容分发