当前位置:网站首页>Meaning of stripe in image
Meaning of stripe in image
2022-04-21 19:50:00 【Little by little progress】
image stride( Image line span ) That is, the control occupied by each row of pixels in memory , For memory alignment or other reasons , The space occupied by each row of pixels in memory is not the width of the image .

As shown in the figure , For image data , Its pixel storage is row by row , However, different compression methods may be used for different image formats , These compressed data also need to be stored in the image , Easy to read and write . In the diagram above , In the picture height Is the height of the image , The width of the image is not the size of a row of data , But only part of the data .stride yes width as well as padding And .width Even if the frame of the image , and padding Is used to store information related to image format ( For example, an image of the same size ,8bit And 32bit Its memory alignment is different ,stride It's different ).pitch and stride similar , It's just pitch For pixels ,stride For bytes . The following figure shows how images are stored

Span -stride
We all know the of computers now cpu All are 32 Bits or 64 Bit cpu, They read at least... At a time 4、8 Bytes , If less than these , Instead, do some extra work , It will take longer . All have a concept called memory alignment , Set the length of the structure to 4、8 Multiple .
The span appears for the same reason . Because the image operation is usually operated on a line by line basis , If all the data of the image are closely arranged , Then there will be very many reads of misaligned memory . Will affect efficiency . And image processing is a race against the clock operation , Therefore, in order to improve the performance, the concept of span is introduced . Span refers to the length of the storage space occupied by a row of image data in the image , It is a memory alignment length greater than or equal to the image width . In this way, the memory can be aligned every time the data is read based on the behavior benchmark , Although there may be a little memory waste , But today, with plenty of memory, it doesn't matter .
https://www.jianshu.com/p/68e05ad85490
版权声明
本文为[Little by little progress]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211943184533.html
边栏推荐
猜你喜欢
随机推荐
剑指Offer:[第29天 动态规划(困难)]--->n个骰子的点数
危化品企业双预防机制数字化建设综合解决方案
高性能分布式缓存Redis--- Redis底层结构和缓存原理 --- 持续更新
Leetcode goat Latin [analog string] the way of leetcode in heroding
【JZ47 礼物的最大价值】
联想公布ESG新进展:承诺2025年全线计算机产品100%含有再生塑料
我的“中医”就医经历
[timing] lstnet: a time series prediction model combining CNN, RNN and ar
mui选项卡怎么实现循环轮播
Building / building reusable QML modules using cmake
Comment déterminer si le BIT nbit de la valeur de type int est 1 ou 0
WLAN Qpower 介绍
1075 PAT Judge (25 分)
如何判斷Int型值的第nbit比特是否是1還是0
使用CMake构建/CMake命令参考
SAP PS 第12节 网络成本计划
Enterprise cross-border e-commerce platform service solution, cross-border e-commerce trade business framework construction, operation and maintenance
GBase 8a对 double 数值进行 round 取舍结果不是四舍五入问题分析及解决方案
redis
手动创建线程池









