摘要:
这是一个老生常谈的问题。每次看的时候都记得到,后面又忘了。记清楚这个三个词,只需要记住三句话。 1. 当一个函数foo,在同一个作用域内存在两个或两个以上的函数签名,就是“重载” 关键词:同一个作用域、 函数签名不同 2. 当派生类中存在一个有基类带virtual关键字的函数,而且函数参数返回值都相 阅读全文
摘要:
1.理解const*与*const 假设有一个ptr指针,它保存变量vbl的地址。 Type* ptr = &vbl; 当使用指针的时候就涉及到两个对象:指针本身以及本身所指的对象。这就意味着const有三个层级的保护。 1.1. 确保ptr指向唯一的内存 有两种写法 Type* const ptr 阅读全文
摘要:
#include <QTextStream> #include <QCoreApplication> #include <QStringList> int main(int argc, char* argv[]) { QCoreApplication app(argc, argv); QTextSt 阅读全文
摘要:
我实现的思路是所有的格式先转成i420,然后进行crop resize 以及cvt的操作。 Get Fourcc code uint32_t Scaler::GetFOURCC(const Scaler::Buffer *src) { uint32_t fourcc = 0; switch (src 阅读全文
摘要:
## 1 memcmp C 库函数 int memcmp(const void *str1, const void *str2, size_t n)) 把存储区 str1 和存储区 str2 的前 n 个字节进行比较。 #include <string.h> int memcmp(const voi 阅读全文
摘要:
libyuv中FourCC定义在video_common.h中。 fourcc是一个32位的无符号的int数,下面这样的宏定义生成。 #ifdef __cplusplus #define FOURCC(a, b, c, d) \ ((static_cast<uint32_t>(a)) | (stat 阅读全文
摘要:
之前虽然用过gdb但是具体的还不太特别深入一直使用的都是vs。 现在在服务器上调试代码,gdb调试不可或缺。 cmake -DRELEASE=OFF .. //编译成调试版本 gdb --args ./可执行程序 其他参数 r //运行 b 某个文件:某一行 //设置断点 b 某个函数 //跳转至某 阅读全文
摘要:
直接对nv21的数据进行resize。 这是之前项目组遗留的一段代码改过来的。结果不太好。 void Scaler::Resize_NV(const Buffer *src, Buffer *dst){ // this function have some problem if (src->widt 阅读全文
摘要:
首先自定义定义的结构 class Scaler { struct Buffer { uint32_t width, height; uint8_t *data[3]; uint32_t stride[3]; ColorFormat color; }; enum ColorFormat { YUV_I 阅读全文
摘要:
#include <iostream> #include <fstream> #include <string> #include <vector> #include <set> using namespace std; void dealOneLine(set<string>& iSet, str 阅读全文