baidut / baidut/co-codec

添加新的帧类型标记

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

要注意匹配标志位,是否sequential,是否progressive,是否lossless。
最初定义
nocompression-0xFF02
anscoding-0xFF03
ansdifferentialcoding-0xFF04
结果出现问题`writing a JPEG file failed - error -1031 - DQT marker missing, no quantization table defined`
定位到错误原因是之前按照帧类型进行了不同中量化表的生成:

``` C
// Lossy modes require a DQT table.
switch(frametype & 0x07) {
case JPGFLAG_BASELINE:
case JPGFLAG_SEQUENTIAL:
case JPGFLAG_PROGRESSIVE:
m_pQuant = new(m_pEnviron) Quantization(m_pEnviron);
m_pQuant->InitDefaultTables(quality,hdrquality,
colortrafo != JPGFLAG_IMAGE_COLORTRANSFORMATION_NONE);
break;
}
```

因此需要匹配标志位。
为了方便修改和理解,改成宏定义放在parameter.hpp里面

``` C
#define JPGCODE_SOF_NO_COMP 0xFF02
#define JPGCODE_SOF_ANS_SEQ 0xFF09
#define JPGCODE_SOF_ANS_DIF_SEQ 0xFF0D
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.