1. HEVC 裸流解码:
main.cpp
#include <iostream>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/imgutils.h>
#include <libswscale/swscale.h>
}
#include "iomanip"
#include <cstdint>
#include <vector>
enum NALUnitType {
TRAIL_N = 1, TRAIL_R = 0, IDR_W_RADL = 19, IDR_N_LP = 20, CRA_NUT = 21
};
enum SliceType { P_SLICE = 0, B_SLICE = 1, I_SLICE = 2 };
// 模拟从比特流中读取 Exp-Golomb 编码
uint32_t readExpGolomb(uint8_t* data, size_t& bitOffset) {
uint32_t leadingZeros = 0;
while ((data[bitOffset / 8] & (1 << (7 - (bitOffset % 8)))) == 0) {
leadingZeros++;
bitOffset++;
}
bitOffset++; // 跳过终止位 '1'
uint32_t val
订阅专栏 解锁全文
9800

被折叠的 条评论
为什么被折叠?



