Claims (78)
1.一种转换编码方法,适用于将第一比特流转换成第二比特流,且该第一比特流是已根据第一量化间距编码后的结果,该转换编码方法包含以下步骤:1. A transcoding method, adapted to convert a first bitstream into a second bitstream, and the first bitstream is the result of coding according to the first quantization interval, the transcoding method comprising the following steps:
步骤(A),将该第一比特流解码;Step (A), decoding the first bit stream;
步骤(B),估计下一输入单元在编码时可使用的比特数目;Step (B), estimating the number of bits that the next input unit can use when encoding;
步骤(C),根据估计出的比特数目,计算出候选量化间距;Step (C), calculating the candidate quantization interval according to the estimated number of bits;
步骤(D),根据该候选量化间距的值,判断出第二量化间距,并求出该第二量化间距与该第一量化间距的比例值,而判断该第二量化间距的方法包括以下子步骤:Step (D), judge the second quantization interval according to the value of the candidate quantization interval, and obtain the ratio value of the second quantization interval and the first quantization interval, and the method for judging the second quantization interval includes the following subsections: step:
子步骤(D-1),设定一个大小等于2倍第一量化间距的第一临界值,且根据该第一临界值和实际使用情形动态地决定出一个第一门限值;Sub-step (D-1), setting a first critical value equal to 2 times the first quantization interval, and dynamically determining a first threshold value according to the first critical value and actual usage conditions;
子步骤(D-2),判断该候选量化间距是否大于或等于该第一门限值,如果是,则跳到子步骤(D-4),如果否,则跳到子步骤(D-3);Sub-step (D-2), judge whether this candidate quantization interval is greater than or equal to this first threshold value, if yes, then skip to sub-step (D-4), if not, then skip to sub-step (D-3 );
子步骤(D-3),将该第二量化间距的值设置为与该第一量化间距相同;及Sub-step (D-3), setting the value of the second quantization interval to be the same as the first quantization interval; and
子步骤(D-4),将该第二量化间距的值设为与该第一临界值相同;Sub-step (D-4), setting the value of the second quantization interval to be the same as the first critical value;
步骤(E),根据步骤(D)得出的比例值,将步骤(A)译码后的数据做移位;及Step (E), shifting the decoded data in step (A) according to the ratio obtained in step (D); and
步骤(F),将步骤(E)处理后的数据编码以得到该第二比特流。Step (F), encoding the data processed in step (E) to obtain the second bit stream.
2.根据权利要求1所述的转换编码方法,其中,子步骤(D-1)中的该第一门限值不能大于该第一临界值,但需大于该第一量化间距。2. The transcoding method according to claim 1, wherein the first threshold value in the sub-step (D-1) cannot be greater than the first critical value, but must be greater than the first quantization interval.
3.根据权利要求2所述的转换编码方法,其中,子步骤(D-1)中的该第一门限值是根据比特压缩情形动态地决定的,且当比特压缩情况未达到预期时,则将该第一门限值的数值调低。3. The transcoding method according to claim 2, wherein, the first threshold value in the sub-step (D-1) is dynamically determined according to the bit compression situation, and when the bit compression situation does not reach expectations, Then the numerical value of the first threshold value is lowered.
4.根据权利要求1所述的转换编码方法,其中,在步骤(E)中,如果比例值为2,则将译码后的数据向右移1位,并且如果比例值为1,则不进行移位。4. The transformation coding method according to claim 1, wherein, in step (E), if the ratio value is 2, then the decoded data is shifted to the right by 1 bit, and if the ratio value is 1, then no Do the shift.
5.根据权利要求1所述的转换编码方法,其中,步骤(B)是根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比特率、帧率,来估计下一输入单元在编码时可使用的比特数目。5. The transcoding method according to claim 1, wherein, step (B) is based on the expected target bit rate, the input unit size to be processed, and the original bit rate and frame rate contained in the first bit stream , to estimate the number of bits that the next input unit can use when encoding.
6.一种转换编码装置,适用于将第一比特流转换成第二比特流,且该第一比特流是已根据第一量化间距编码后的结果,该转换编码装置包含:6. A transcoding device adapted to convert a first bit stream into a second bit stream, and the first bit stream is the result of encoding according to a first quantization interval, the transcoding device comprising:
译码单元,用于用于对该第一比特流译码;a decoding unit, configured to decode the first bit stream;
比特配置单元,用于估计出下一输入单元可使用的比特数;A bit configuration unit, used to estimate the number of bits available for the next input unit;
量化间距计算单元,用于与该比特配置单元电连接,并根据该比特配置单元估计出的位数计算候选量化间距;A quantization interval calculation unit, configured to be electrically connected to the bit configuration unit, and calculate candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,用于接收该第一量化间距的值,并设定一个大小等于2倍第一量化间距的第一临界值,且根据该第一临界值和实际使用情形动态地决定出第一门限值;The analysis unit is configured to receive the value of the first quantization interval, and set a first critical value equal to twice the first quantization interval, and dynamically determine the first gate according to the first critical value and actual usage conditions limit value;
量化间距决定单元,用于与该量化间距计算单元及该分析单元电连接,并当该候选量化间距大于或等于该第一门限值时,将该第二量化间距的值设为与该第一临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设为与该第一量化间距相同;且得到该第二量化间距与该第一量化间距的比例值;A quantization interval determination unit, configured to be electrically connected to the quantization interval calculation unit and the analysis unit, and when the candidate quantization interval is greater than or equal to the first threshold value, set the second quantization interval to be equal to the second quantization interval a critical value is the same; and when the candidate quantization interval is smaller than the first threshold value, the value of the second quantization interval is set to be the same as the first quantization interval; and the second quantization interval and the first quantization interval are obtained The scale value of the spacing;
移位单元,用于与该量化间距决定单元及该译码单元电连接,并根据该量化间距决定单元求出的比例值将该译码单元译码后的数据做移位;及a shift unit, configured to be electrically connected to the quantization distance determination unit and the decoding unit, and to shift the data decoded by the decoding unit according to the ratio value calculated by the quantization distance determination unit; and
编码单元,用于与该移位单元电连接,并将该移位单元处理后的数据进行编码以得到该第二比特流。The encoding unit is configured to be electrically connected to the shifting unit, and encode the data processed by the shifting unit to obtain the second bit stream.
7.根据权利要求6所述的转换编码装置,其中,该分析单元在决定该第一门限值时,会限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。7. The transcoding device according to claim 6, wherein, when the analysis unit determines the first threshold value, it will restrict the first threshold value not to be greater than the first critical value, but must be greater than the first threshold value Quantify spacing.
8.根据权利要求7所述的转换编码装置,其中,该分析单元是根据比特压缩情形来动态地决定出该第一门限值,而当比特压缩情况未达到预期时,则该分析单元将该第一门限值的数值调低。8. The transcoding device according to claim 7, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit will The numerical value of the first threshold is lowered.
9.根据权利要求6所述的转换编码装置,其中,如果比例值为2,该移位单元则将译码后的数据向右移1位,且如果比例值为1,则不进行移位。9. The transform encoding device according to claim 6, wherein, if the ratio value is 2, the shift unit shifts the decoded data to the right by 1 bit, and if the ratio value is 1, no shift is performed .
10.依据申请专利范围第6项所述之转换编码装置,其中,该比特配置单元是根据预期的目标比特、要处理的输入单位大小,及该第一比特流中所包含的原始比特、帧率,来估计下一输入单元在编码时可使用的比特数目。10. According to the transcoding device described in item 6 of the scope of patent application, the bit configuration unit is based on the expected target bit, the size of the input unit to be processed, and the original bit and frame included in the first bit stream rate to estimate the number of bits available for encoding the next input unit.
11.一种转换编码方法,适用于将第一比特流转换成第二比特流,且该第一比特流是已根据第一量化间距编码后的结果,该转换编码方法包含以下步骤:11. A transcoding method, adapted to convert a first bitstream into a second bitstream, and the first bitstream is the result of encoding according to a first quantization interval, the transcoding method comprising the following steps:
步骤(A),将该第一比特流解码;Step (A), decoding the first bit stream;
步骤(B),估计下一输入单元在编码时可使用的比特数目;Step (B), estimating the number of bits that the next input unit can use when encoding;
步骤(C),根据估计出的比特数目,计算出候选量化间距;Step (C), calculating the candidate quantization interval according to the estimated number of bits;
步骤(D),根据该候选量化间距的值,判断出第二量化间距,并求出该第二量化间距与该第一量化间距的比例,而判断该第二量化间距的方法包括以下子步骤:Step (D), judge the second quantization interval according to the value of the candidate quantization interval, and obtain the ratio of the second quantization interval to the first quantization interval, and the method for judging the second quantization interval includes the following sub-steps :
子步骤(D-1),设定大小等于2倍第一量化间距的第一临界值,且根据该第一临界值和实际使用情形动态地决定第一门限值;Sub-step (D-1), setting a first critical value equal to 2 times the first quantization interval, and dynamically determining the first threshold value according to the first critical value and the actual use situation;
子步骤(D-2),判断该候选量化间距是否大于或等于该第一门限值,如果是,则跳到子步骤(D-3),如果否,则跳到子步骤(D-5);Sub-step (D-2), judge whether this candidate quantization interval is greater than or equal to this first threshold value, if yes, then skip to sub-step (D-3), if not, then skip to sub-step (D-5 );
子步骤(D-3),分析比特比例与量化间距的关系,以判断是否有一个大于该第一临界值的第二临界值,如果是,则跳到子步骤(D-4),如果否,则跳到子步骤(D-6);且在子步骤(D-3)中,判断是否有该第二临界值的方式是判断该比特比例与量化间距的关系中,是否存在有另一等级的比特比例,且此另一等级的比特比例小于该第一临界值所在之等级,如果有,则表示该第二临界值存在;Sub-step (D-3), analyze the relationship between bit ratio and quantization interval, to judge whether there is a second critical value greater than the first critical value, if yes, then skip to sub-step (D-4), if not , then skip to sub-step (D-6); and in sub-step (D-3), the way to judge whether there is the second critical value is to judge whether there is another The bit ratio of the class, and the bit ratio of this other class is smaller than the class where the first critical value is located, if there is, it means that the second critical value exists;
子步骤(D-4),将该第二临界值的大小设为与4倍第一量化间距相同,且根据该第二临界值和实际使用情形动态地决定第二门限值,并判断该候选量化间距的值是否大于或等于该第二门限值,如果是,则跳到子步骤(D-7),如果否,则跳到子步骤(D-6);Sub-step (D-4), the size of the second critical value is set to be the same as 4 times the first quantization interval, and dynamically determine the second threshold value according to the second critical value and the actual use situation, and determine the Whether the value of the candidate quantization interval is greater than or equal to the second threshold value, if yes, then skip to substep (D-7), if not, then skip to substep (D-6);
子步骤(D-5),将该第二量化间距的值设为与该第一量化间距相同;及Sub-step (D-5), setting the value of the second quantization interval to be the same as the first quantization interval; and
子步骤(D-6),将该第二量化间距的值设为与该第一临界值相同;Sub-step (D-6), setting the value of the second quantization interval to be the same as the first critical value;
子步骤(D-7),将该第二量化间距的值设为与该第二临界值相同;Sub-step (D-7), setting the value of the second quantization interval to be the same as the second critical value;
步骤(E),根据步骤(D)得出的比例值,将步骤(A)译码后的数据做移位;及Step (E), shifting the decoded data in step (A) according to the ratio obtained in step (D); and
步骤(F),将移位后的数据编码以得到该第二比特流。Step (F), encoding the shifted data to obtain the second bit stream.
12.根据权利要求11所述的转换编码方法,其中,子步骤(D-1)中的该第一门限值不能大于该第一临界值,但需大于该第一量化间距。12. The transform coding method according to claim 11, wherein the first threshold value in the sub-step (D-1) cannot be greater than the first critical value, but must be greater than the first quantization interval.
13.根据权利要求12所述的转换编码方法,其中,子步骤(D-1)中的该第一门限值是根据比特压缩情形动态地决定的,且当比特压缩情况未达到预期时,则将该第一门限值的数值调低。13. The transcoding method according to claim 12, wherein the first threshold value in the sub-step (D-1) is dynamically determined according to the bit compression situation, and when the bit compression situation does not reach expectations, Then the numerical value of the first threshold value is lowered.
14.根据权利要求13所述的转换编码方法,其中,子步骤(D-4)中的该第二门限值不能大于该第二临界值,且也不能小于该第一临界值。14. The transcoding method according to claim 13, wherein the second threshold value in the sub-step (D-4) cannot be larger than the second critical value, nor can it be smaller than the first critical value.
15.根据权利要求11所述的转换编码方法,其中,在步骤(E)中,如果比例值为4,则将译码后的数据向右移2位,如果比例值为2,则将译码后的数据向右移1位,且如果比例值为1,则不进行移位。15. The conversion coding method according to claim 11, wherein, in step (E), if the ratio value is 4, then the decoded data is shifted to the right by 2 bits, and if the ratio value is 2, then the decoded data is shifted to the right by 2 bits. The coded data is shifted to the right by 1 bit, and if the ratio value is 1, no shifting is performed.
16.根据权利要求11所述的转换编码方法,其中,步骤(B)是根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比特率、帧率,来估计下一输入单元在编码时可使用的比特数目。16. The conversion coding method according to claim 11, wherein, step (B) is based on the expected target bit rate, the input unit size to be processed, and the original bit rate and frame rate contained in the first bit stream , to estimate the number of bits that the next input unit can use when encoding.
17.一种转换编码装置,适用于将第一比特流转换成第二比特流,且该第一比特流是已根据第一量化间距编码后的结果,该转换编码装置包含:17. A transcoding device adapted to convert a first bitstream into a second bitstream, and the first bitstream is the result of encoding according to a first quantization interval, the transcoding device comprising:
译码单元,用于用于对该第一比特流译码;a decoding unit, configured to decode the first bit stream;
比特配置单元,用于估计出下一输入单元可使用的比特数;A bit configuration unit, used to estimate the number of bits available for the next input unit;
量化间距计算单元,与该比特配置单元电连接,并根据该比特配置单元估计出的比特数来计算候选量化间距;A quantization interval calculation unit is electrically connected to the bit configuration unit, and calculates candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,用于接收该第一量化间距的值,并设定一个大小等于2倍第一量化间距的第一临界值,且根据该第一临界值和实际使用情形动态地决定出第一门限值,且设定一个大小等于4倍第一量化间距的第二临界值,且根据该第二临界值和实际使用情形动态地决定出一个第二门限值;The analysis unit is configured to receive the value of the first quantization interval, and set a first critical value equal to twice the first quantization interval, and dynamically determine the first gate according to the first critical value and actual usage conditions Limit value, and set a second critical value equal to 4 times the first quantization interval, and dynamically determine a second threshold value according to the second critical value and actual usage conditions;
量化间距决定单元,用于与该量化间距计算单元及该分析单元电连接,并当该候选量化间距大于或等于该第二门限值时,将该第二量化间距的值设为与该第二临界值相同;当该候选量化间距大于或等于该第一门限值且小于该第二门限值时,将该第二量化间距的值设为与该第一临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设为与该第一量化间距相同;且得到该第二量化间距与该第一量化间距的比例值;A quantization interval determination unit, configured to be electrically connected to the quantization interval calculation unit and the analysis unit, and when the candidate quantization interval is greater than or equal to the second threshold value, set the value of the second quantization interval to be the same as the second threshold value The two critical values are the same; when the candidate quantization interval is greater than or equal to the first threshold value and smaller than the second threshold value, the value of the second quantization interval is set to be the same as the first critical value; and when the When the candidate quantization interval is smaller than the first threshold value, setting the value of the second quantization interval to be the same as the first quantization interval; and obtaining a ratio value of the second quantization interval to the first quantization interval;
移位单元,用于与该量化间距决定单元及该译码单元电连接,并根据该量化间距决定单元求出的比例值将该译码单元译码后的数据做移位;及a shift unit, configured to be electrically connected to the quantization distance determination unit and the decoding unit, and to shift the data decoded by the decoding unit according to the ratio value calculated by the quantization distance determination unit; and
编码单元,用于与该移位单元电连接,并将该移位单元处理后的数据进行编码以得到该第二比特流。The encoding unit is configured to be electrically connected to the shifting unit, and encode the data processed by the shifting unit to obtain the second bit stream.
18.根据权利要求17所述的转换编码装置,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。18. The transcoding device according to claim 17, wherein when the analysis unit determines the first threshold value, the first threshold value cannot be greater than the first critical value, but must be greater than the first quantization spacing.
19.根据权利要求18所述的转换编码装置,其中,该分析单元根据比特压缩情形动态地决定出该第一门限值,而当比特压缩情况未达到预期时,则该分析单元将该第一门限值的数值调低。19. The transcoding device according to claim 18, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit uses the first threshold value A numerical value of the threshold value is lowered.
20.根据权利要求19所述的转换编码装置,其中,该分析单元在决定该第二门限值时,限制该第二门限值不能大于该第二临界值,且也不能小于该第一临界值。20. The transcoding device according to claim 19, wherein when the analyzing unit determines the second threshold value, the second threshold value is restricted to be neither greater than the second critical value nor less than the first critical value. critical value.
21.根据权利要求17所述的转换编码装置,其中,如果比例值为4,该移位单元则将译码后的数据向右移2位,如果比例值为2,该移位单元则将译码后的数据向右移1位,且如果比例值为1,该移位单元不进行移位。21. The transform encoding device according to claim 17, wherein, if the ratio value is 4, the shift unit will shift the decoded data to the right by 2 bits, and if the ratio value is 2, the shift unit will The decoded data is shifted to the right by 1 bit, and if the ratio value is 1, the shift unit does not shift.
22.根据权利要求17所述的转换编码装置,其中,该比特配置单元是根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比特率、帧率,来估计下一输入单元在编码时可使用的比特数目。22. The transcoding device according to claim 17, wherein the bit configuration unit is based on the expected target bit rate, the input unit size to be processed, and the original bit rate and frame rate included in the first bit stream , to estimate the number of bits that the next input unit can use when encoding.
23.一种转换编码方法,适用于将第一比特流转换成第二比特流,且该第一比特流是已根据第一量化间距编码后的结果,该转换编码方法包含以下步骤:23. A transcoding method, adapted to convert a first bitstream into a second bitstream, and the first bitstream is the result of encoding according to a first quantization interval, the transcoding method comprising the following steps:
步骤(A),将该第一比特流解码;Step (A), decoding the first bit stream;
步骤(B),将译码后的数据进行反量化处理;Step (B), dequantizing the decoded data;
步骤(C),估计下一输入单元在编码时可使用的比特数目;Step (C), estimating the number of bits that the next input unit can use when encoding;
步骤(D),根据估计出的比特数目,计算出候选量化间距;Step (D), calculating the candidate quantization interval according to the estimated number of bits;
步骤(E),根据该候选量化间距的值,判断出一个第二量化间距,且判断的方法包括以下子步骤:Step (E), according to the value of the candidate quantization interval, judge a second quantization interval, and the method for judging includes the following sub-steps:
子步骤(E-1),分析比特比例与量化间距的关系,以决定出一个第一临界值,并根据该第一临界值和实际使用情形动态地决定出一个第一门限值,而决定出该第一临界值的方式是将该第一临界值的数值设为与在第二大等级的比特比例范围中具有最小值的量化间距相同,但如果该第一临界值在此设定下小于2倍第一量化间距,则将该第一临界值直接改设为与2倍第一量化间距的值相同;Sub-step (E-1), analyzing the relationship between the bit ratio and the quantization interval, to determine a first critical value, and dynamically determine a first threshold value according to the first critical value and the actual use situation, and determine The way to determine the first threshold value is to set the value of the first threshold value to be the same as the quantization pitch that has the smallest value in the bit ratio range of the second largest level, but if the first threshold value is set at this is less than 2 times the first quantization interval, then directly change the first critical value to be the same as the value of 2 times the first quantization interval;
子步骤(E-2),判断该候选量化间距是否大于或等于该第一门限值,如果是,则跳到子步骤(E-4),如果否,则跳到子步骤(E-3);Sub-step (E-2), judge whether this candidate quantization interval is greater than or equal to this first threshold value, if yes, then skip to sub-step (E-4), if not, then skip to sub-step (E-3 );
子步骤(E-3),将该第二量化间距的值设置为与该第一量化间距相同;及Sub-step (E-3), setting the value of the second quantization interval to be the same as the first quantization interval; and
子步骤(E-4),将该第二量化间距的值设置为与该第一临界值相同;Sub-step (E-4), setting the value of the second quantization interval to be the same as the first critical value;
步骤(F),以该第二量化间距对反量化后的数据进行量化处理;及Step (F), performing quantization processing on the dequantized data with the second quantization interval; and
步骤(G),将量化后的数据编码以得到该第二比特流。Step (G), encoding the quantized data to obtain the second bit stream.
24.根据权利要求23所述的转换编码方法,其中,子步骤(E-1)中的该第一门限值不能大于该第一临界值,但需大于该第一量化间距。24. The transform coding method according to claim 23, wherein the first threshold value in the sub-step (E-1) cannot be greater than the first critical value, but must be greater than the first quantization interval.
25.根据权利要求24所述的转换编码方法,其中,子步骤(E-1)中的该第一门限值是根据比特压缩情形来动态地决定的,且当比特压缩情况未达预期时,则将该第一门限值的数值调低。25. The transcoding method according to claim 24, wherein the first threshold value in the sub-step (E-1) is dynamically determined according to the bit compression situation, and when the bit compression situation does not meet expectations , then lower the value of the first threshold.
26.根据权利要求23所述的转换编码方法,其中,步骤(C)是根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比特率、帧率,来估计下一输入单元在编码时可使用的比特数目。26. The transformation coding method according to claim 23, wherein, step (C) is based on the expected target bit rate, the input unit size to be processed, and the original bit rate and frame rate contained in the first bit stream , to estimate the number of bits available for encoding the next input unit.
27.一种转换编码装置,适用于将第一比特流转换成第二比特流,且该第一比特流是已根据第一量化间距编码后的结果,该转换编码装置包含:27. A transcoding device adapted to convert a first bitstream into a second bitstream, the first bitstream being the result of encoding according to a first quantization interval, the transcoding device comprising:
译码单元,用于用于对该第一比特流译码;a decoding unit, configured to decode the first bit stream;
反量化单元,用于与该译码单元电连接,并将该译码单元译码后的数据以该第一量化间距进行反量化;An inverse quantization unit, configured to be electrically connected to the decoding unit, and dequantize the data decoded by the decoding unit at the first quantization interval;
比特配置单元,用于估计出下一输入单元可使用的比特数;A bit configuration unit, used to estimate the number of bits available for the next input unit;
量化间距计算单元,用于与该比特配置单元电连接,并根据该比特配置单元估计出的比特数计算候选量化间距;A quantization interval calculation unit, configured to be electrically connected to the bit configuration unit, and calculate candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,用于接收该第一量化间距的值,并分析比特比例与量化间距的关系,以判断出一个第一临界值,且根据实际使用情形及该第一临界值决定出一个第一门限值,而决定出该第一临界值的方式是将该第一临界值的数值设置为与在第二大等级的比特比例范围中具有最小值的量化间距相同,但如果该第一临界值在此设定下小于2倍第一量化间距,则将该第一临界值直接改设为与2倍第一量化间距的值相同;及An analysis unit, configured to receive the value of the first quantization interval, and analyze the relationship between the bit ratio and the quantization interval to determine a first critical value, and determine a first gate according to the actual use situation and the first critical value limit, and the first threshold is determined by setting the value of the first threshold to be the same as the quantization pitch that has the smallest value in the bit scale range of the second largest level, but if the first threshold Under this setting, it is less than 2 times the first quantization interval, then directly change the first critical value to be the same as the value of 2 times the first quantization interval; and
量化间距决定单元,用于与该分析单元及该量化间距计算单元电连接,并当该候选量化间距大于或等于该第一门限值时,将该第二量化间距的值设为与该第一临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设为与该第一量化间距相同;A quantization interval determination unit, configured to be electrically connected to the analysis unit and the quantization interval calculation unit, and when the candidate quantization interval is greater than or equal to the first threshold value, set the value of the second quantization interval to be the same as the second quantization interval a threshold value is the same; and when the candidate quantization interval is smaller than the first threshold value, the value of the second quantization interval is set to be the same as the first quantization interval;
量化单元,用于与该量化间距决定单元及该反量化单元电连接,并根据该量化间距决定单元决定出的第二量化间距,对由该反量化单元反量化后的数据进行量化;及a quantization unit, configured to be electrically connected to the quantization interval determination unit and the inverse quantization unit, and to quantize the data dequantized by the inverse quantization unit according to the second quantization interval determined by the quantization interval determination unit; and
编码单元,用于与该量化单元电连接,并将该量化单元量化后的数据进行编码以得到该第二比特流。The encoding unit is configured to be electrically connected to the quantization unit, and encode the quantized data of the quantization unit to obtain the second bit stream.
28.根据权利要求27所述的转换编码装置,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。28. The transcoding device according to claim 27, wherein when the analysis unit determines the first threshold value, the first threshold value cannot be greater than the first critical value, but must be greater than the first quantization spacing.
29.根据权利要求28所述的转换编码装置,其中,该分析单元根据比特压缩情形动态地决定出该第一门限值,而当比特压缩情况未达到预期时,该分析单元则将该第一门限值的数值调低。29. The transcoding device according to claim 28, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit will set the first threshold value to A numerical value of the threshold value is lowered.
30.根据权利要求27所述的转换编码装置,其中,该比特配置单元是根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比特率、帧率,来估计下一输入单元在编码时可使用的比特数目。30. The transcoding device according to claim 27, wherein the bit configuration unit is based on the expected target bit rate, the input unit size to be processed, and the original bit rate and frame rate included in the first bit stream , to estimate the number of bits that the next input unit can use when encoding.
31.一种转换编码方法,适用于将第一比特流转换成第二比特流,且该第一比特流是已根据第一量化间距编码后的结果,该转换编码方法包含以下步骤:31. A transcoding method adapted to convert a first bitstream into a second bitstream, the first bitstream being the result of encoding according to a first quantization interval, the transcoding method comprising the steps of:
步骤(A),将该第一比特流解码;Step (A), decoding the first bit stream;
步骤(B),将译码后的数据进行反量化处理;Step (B), dequantizing the decoded data;
步骤(C),估计下一输入单元在编码时可使用的比特数目;Step (C), estimating the number of bits that the next input unit can use when encoding;
步骤(D),根据估计出的比特数目,计算出候选量化间距;Step (D), calculating the candidate quantization interval according to the estimated number of bits;
步骤(E),根据该候选量化间距的值,判断出一个第二量化间距,且判断的方法包括以下子步骤:Step (E), according to the value of the candidate quantization interval, judge a second quantization interval, and the method for judging includes the following sub-steps:
子步骤(E-1),分析比特比例与量化间距的关系,以决定出一个第一临界值,并根据该第一临界值和实际使用情形动态地决定出一个第一门限值,而决定出该第一临界值的方式是将该第一临界值的数值设为与在第二大等级的比特比例范围中具有最小值的量化间距相同,但如果该第一临界值在此设定下小于2倍第一量化间距,则将该第一临界值直接改设为与2倍第一量化间距的值相同;Sub-step (E-1), analyzing the relationship between the bit ratio and the quantization interval, to determine a first critical value, and dynamically determine a first threshold value according to the first critical value and the actual use situation, and determine The way to determine the first threshold value is to set the value of the first threshold value to be the same as the quantization pitch that has the smallest value in the bit ratio range of the second largest level, but if the first threshold value is set at this is less than 2 times the first quantization interval, then directly change the first critical value to be the same as the value of 2 times the first quantization interval;
子步骤(E-2),判断该候选量化间距是否大于或等于该第一门限值,如果是,则跳到子步骤(E-3),如果否,则跳到子步骤(E-5);Sub-step (E-2), judge whether this candidate quantization interval is greater than or equal to this first threshold value, if yes, then skip to sub-step (E-3), if not, then skip to sub-step (E-5 );
子步骤(E-3),分析比特比例与量化间距的关系,以判断是否有一个大于该第一临界值的第二临界值,如果是,则跳到子步骤(E-4),如果否,则跳到子步骤(E-6);且在子步骤(E-3)中,判断是否有该第二临界值的方式是判断该比特比例与量化间距的关系中,是否存在有另一等级的比特比例,且此另一等级的比特比例小于该第一临界值所在的等级,如果有,则表示该第二临界值存在,则设置该第二临界值为与在此较低等级的比特比例范围中具有最小值的量化间距相同;Sub-step (E-3), analyze the relationship between bit ratio and quantization interval, to judge whether there is a second critical value greater than the first critical value, if yes, then skip to sub-step (E-4), if not , then jump to sub-step (E-6); and in sub-step (E-3), the way to judge whether there is the second critical value is to judge whether there is another The bit ratio of the level, and the bit ratio of this other level is smaller than the level where the first critical value is, if there is, it means that the second critical value exists, then set the second critical value to be the same as that of the lower level The quantization interval with the minimum value in the bit scale range is the same;
子步骤(E-4),判断该候选量化间距的值是否大于或等于一个第二门限值,如果是,则跳到子步骤(E-7),如果否,则跳到子步骤(E-6),而该第二门限值是根据该第二临界值和实际使用情形动态地决定的;Sub-step (E-4), judge whether the value of this candidate quantization interval is greater than or equal to a second threshold value, if yes, then skip to sub-step (E-7), if not, then skip to sub-step (E-7) -6), and the second threshold value is dynamically determined according to the second critical value and the actual usage situation;
子步骤(E-5),将该第二量化间距的值设置为与该第一量化间距相同;Sub-step (E-5), setting the value of the second quantization interval to be the same as the first quantization interval;
子步骤(E-6),将该第二量化间距的值设置为与该第一临界值相同;及Sub-step (E-6), setting the value of the second quantization interval to be the same as the first critical value; and
子步骤(E-7),将该第二量化间距的值设置为与该第二临界值相同;Sub-step (E-7), setting the value of the second quantization interval to be the same as the second critical value;
步骤(F),以该第二量化间距对反量化后的数据进行量化处理;及Step (F), performing quantization processing on the dequantized data with the second quantization interval; and
步骤(G),对量化后的数据编码以得到该第二比特流。Step (G), encoding the quantized data to obtain the second bit stream.
32.根据权利要求31所述的转换编码方法,其中,子步骤(E-1)中的该第一门限值不能大于该第一临界值,但需大于该第一量化间距。32. The transform coding method according to claim 31, wherein the first threshold value in the sub-step (E-1) cannot be greater than the first critical value, but must be greater than the first quantization interval.
33.根据权利要求32所述的转换编码方法,其中,子步骤(E-1)中的该第一门限值是根据比特压缩情形动态地决定的,且当比特压缩情况未达到预期时,将该第一门限值的数值调低。33. The transcoding method according to claim 32, wherein the first threshold in the sub-step (E-1) is dynamically determined according to the bit compression situation, and when the bit compression situation does not meet expectations, Lower the value of the first threshold.
34.根据权利要求33所述的转换编码方法,其中,子步骤(E-4)中的该第二门限值不能大于该第二临界值,且也不能小于该第一临界值。34. The transcoding method according to claim 33, wherein the second threshold value in the sub-step (E-4) cannot be larger than the second critical value, nor can it be smaller than the first critical value.
35.根据权利要求31所述的转换编码方法,其中,步骤(C)是根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比特率、帧率,来估计下一输入单元在编码时可使用的比特数目。35. The transformation coding method according to claim 31, wherein, step (C) is based on the expected target bit rate, the input unit size to be processed, and the original bit rate and frame rate contained in the first bit stream , to estimate the number of bits that the next input unit can use when encoding.
36.一种转换编码装置,适用于将第一比特流转换成第二比特流,且该第一比特流是已根据第一量化间距编码后的结果,该转换编码装置包含:36. A transcoding apparatus adapted to convert a first bitstream into a second bitstream, the first bitstream being the result of encoding according to a first quantization interval, the transcoding apparatus comprising:
译码单元,用于对该第一比特流译码;a decoding unit, configured to decode the first bit stream;
反量化单元,用于与该译码单元电连接,并将该译码单元译码后的数据以该第一量化间距进行反量化;An inverse quantization unit, configured to be electrically connected to the decoding unit, and dequantize the data decoded by the decoding unit at the first quantization interval;
比特配置单元,用于估计出下一输入单元可使用的比特数;A bit configuration unit, used to estimate the number of bits available for the next input unit;
量化间距计算单元,用于与该比特配置单元电连接,并根据该比特配置单元估计出的比特数计算候选量化间距;A quantization interval calculation unit, configured to be electrically connected to the bit configuration unit, and calculate candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,用于接收该第一量化间距的值,并分析比特比例与量化间距的关系,以判断出一个第一临界值和一个第二临界值,且根据实际使用情形及分别根据该第一临界值和该第二临界值决定出一个第一门限值和一个第二门限值,而决定出该第一临界值的方式是将该第一临界值的数值设置为与在第二大等级的比特比例范围中具有最小值的量化间距相同,但如果该第一临界值在此设定下小于2倍第一量化间距,则将该第一临界值直接改设为与2倍第一量化间距的值相同;而判断是否有该第二临界值的方式是判断该比特比例与量化间距的关系中,是否存在有另一等级的比特比例,且此另一等级的比特比例小于该第一临界值所在的等级,如果有,则表示该第二临界值存在,则设置该第二临界值为与在此较低等级的比特比例范围中具有最小值的量化间距相同;及The analysis unit is used to receive the value of the first quantization interval, and analyze the relationship between the bit ratio and the quantization interval to determine a first critical value and a second critical value, and according to the actual use situation and respectively according to the first The critical value and the second critical value determine a first threshold value and a second threshold value, and the way to determine the first critical value is to set the value of the first critical value to be equal to the second largest threshold value The quantization interval with the smallest value in the bit scale range of the level is the same, but if the first critical value is smaller than 2 times the first quantization interval under this setting, then the first critical value is directly changed to be the same as 2 times the first The value of the quantization distance is the same; and the way to judge whether there is the second critical value is to judge whether there is another level of bit proportion in the relationship between the bit ratio and the quantization distance, and the bit ratio of this other level is smaller than the first The level at which a critical value is located, if any, indicates that the second critical value exists, and the second critical value is set to be the same as the quantization interval having the smallest value in the bit ratio range of the lower level; and
量化间距决定单元,用于与该分析单元及该量化间距计算单元电连接,并当该候选量化间距大于或等于该第一门限值且小于该第二门限值时,将该第二量化间距的值设置为与该第一临界值相同;且当该候选量化间距大于该第二门限值时,将该第二量化间距的值设置为与该第二临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设置为与该第一量化间距相同;a quantization interval determination unit, configured to be electrically connected to the analysis unit and the quantization interval calculation unit, and when the candidate quantization interval is greater than or equal to the first threshold value and smaller than the second threshold value, the second quantization interval The value of the interval is set to be the same as the first critical value; and when the candidate quantization interval is greater than the second threshold value, the value of the second quantization interval is set to be the same as the second critical value; and when the candidate When the quantization interval is smaller than the first threshold value, the value of the second quantization interval is set to be the same as the first quantization interval;
量化单元,用于与该量化间距决定单元及该反量化单元电连接,并根据该量化间距决定单元决定出的第二量化间距,对由该反量化单元反量化后的数据进行量化;及a quantization unit, configured to be electrically connected to the quantization interval determination unit and the inverse quantization unit, and to quantize the data dequantized by the inverse quantization unit according to the second quantization interval determined by the quantization interval determination unit; and
编码单元,用于与该量化单元电连接,并将该量化单元量化后的数据进行编码以得到该第二比特流。The encoding unit is configured to be electrically connected to the quantization unit, and encode the quantized data of the quantization unit to obtain the second bit stream.
37.根据权利要求36所述的转换编码装置,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。37. The transcoding device according to claim 36, wherein when the analysis unit determines the first threshold value, the first threshold value cannot be greater than the first critical value, but must be greater than the first quantization spacing.
38.根据权利要求37所述的转换编码装置,其中,该分析单元根据比特压缩情形动态地决定出该第一门限值,而当比特压缩情况未达到预期时,该分析单元将该第一门限值的数值调低。38. The transcoding device according to claim 37, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit uses the first threshold The value of the threshold value is lowered.
39.根据权利要求38所述的转换编码装置,其中,该分析单元在决定该第二门限值时,限制该第二门限值不能大于该第二临界值,且也不能小于该第一临界值。39. The transcoding device according to claim 38, wherein when the analyzing unit determines the second threshold value, the second threshold value is restricted to be neither greater than the second critical value nor less than the first critical value. critical value.
40.根据权利要求36所述的转换编码装置,其中,该比特配置单元根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比特率、帧率,来估计下一输入单元在编码时可使用的比特数目。40. The transcoding device according to claim 36, wherein the bit configuration unit is based on the expected target bit rate, the input unit size to be processed, and the original bit rate and frame rate included in the first bit stream, to estimate the number of bits available for encoding the next input unit.
41.一种集成电路,适用于接收第一比特流,且将该第一比特流转换成第二比特流输出,而该第一比特流是已根据第一量化间距编码后的结果,该集成电路包含:41. An integrated circuit adapted to receive a first bit stream and convert the first bit stream into a second bit stream for output, the first bit stream being the result of encoding according to a first quantization interval, the integrated The circuit contains:
译码单元,用于对该第一比特流译码;a decoding unit, configured to decode the first bit stream;
比特配置单元,用于估计出下一输入单元可使用的位数;A bit configuration unit, used to estimate the number of bits that can be used by the next input unit;
量化间距计算单元,用于与该比特配置单元电连接,并根据该比特配置单元估计出的比特数计算候选量化间距;A quantization interval calculation unit, configured to be electrically connected to the bit configuration unit, and calculate candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,用于接收该第一量化间距的值,并设定一个大小等于2倍第一量化间距的第一临界值,且根据该第一临界值和实际使用情形动态地决定出一个第一门限值;The analysis unit is configured to receive the value of the first quantization interval, set a first critical value equal to twice the first quantization interval, and dynamically determine a first critical value according to the first critical value and actual usage conditions. Threshold value;
量化间距决定单元,与该量化间距计算单元及该分析单元电连接,并当该候选量化间距大于或等于该第一门限值时,将该第二量化间距的值设置为与该第一临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设置为与该第一量化间距相同;且得到该第二量化间距与该第一量化间距的比例值;A quantization interval determination unit is electrically connected to the quantization interval calculation unit and the analysis unit, and when the candidate quantization interval is greater than or equal to the first threshold value, sets the value of the second quantization interval to be equal to the first threshold value. The value is the same; and when the candidate quantization interval is smaller than the first threshold value, the value of the second quantization interval is set to be the same as the first quantization interval; and the second quantization interval and the first quantization interval are obtained proportional value;
移位单元,与该量化间距决定单元及该译码单元电连接,并根据该量化间距决定单元求出的比例值将该译码单元译码后的数据做移位;及a shift unit, electrically connected to the quantization interval determination unit and the decoding unit, and shifts the data decoded by the decoding unit according to the ratio value calculated by the quantization interval determination unit; and
编码单元,与该移位单元电连接,并将该移位单元处理后的数据进行编码以得到该第二比特流。An encoding unit is electrically connected to the shifting unit, and encodes the data processed by the shifting unit to obtain the second bit stream.
42.根据权利要求41所述的集成电路,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。42. The integrated circuit according to claim 41, wherein, when the analysis unit determines the first threshold value, the first threshold value cannot be greater than the first critical value, but must be greater than the first quantization interval .
43.根据权利要求42所述的集成电路,其中,该分析单元根据比特压缩情形动态地决定出该第一门限值,而当比特压缩情况未达到预期时,该分析单元将该第一门限值的数值调低。43. The integrated circuit according to claim 42, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit uses the first threshold The value of the limit value is lowered.
44.根据权利要求41所述的集成电路,其中,如果比例值为2,该移位单元则将译码后的数据向右移1位,且如果比例值为1,则不进行移位。44. The integrated circuit of claim 41, wherein if the ratio is 2, the shift unit shifts the decoded data to the right by 1 bit, and if the ratio is 1, no shifting is performed.
45.根据权利要求41所述的集成电路,其中,该比特配置单元根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比特率、帧率,来估计下一输入单元在编码时可使用的比特数目。45. The integrated circuit according to claim 41, wherein the bit configuration unit is configured according to the expected target bit rate, the input unit size to be processed, and the original bit rate and frame rate included in the first bit stream Estimates the number of bits available for encoding the next input unit.
46.一种集成电路,适用于接收第一比特流译码后的数据,且该第一比特流是已根据第一量化间距编码后的结果,该集成电路包含:46. An integrated circuit adapted to receive decoded data of a first bitstream that has been encoded according to a first quantization interval, the integrated circuit comprising:
比特配置单元,用于估计出下一输入单元可使用的比特数;A bit configuration unit, used to estimate the number of bits available for the next input unit;
量化间距计算单元,与该比特配置单元电连接,并根据该比特配置单元估计出的比特数计算候选量化间距;A quantization interval calculation unit is electrically connected to the bit configuration unit, and calculates candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,用于接收该第一量化间距的值,并设定一个大小等于2倍第一量化间距的第一临界值,且根据该第一临界值和实际使用情形动态地决定出一个第一门限值;The analysis unit is configured to receive the value of the first quantization interval, set a first critical value equal to twice the first quantization interval, and dynamically determine a first critical value according to the first critical value and actual usage conditions. Threshold value;
量化间距决定单元,与该量化间距计算单元及该分析单元电连接,并当该候选量化间距大于或等于该第一门限值时,将该第二量化间距的值设置为与该第一临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设置为与该第一量化间距相同;且得到该第二量化间距与该第一量化间距的比例值。A quantization interval determination unit is electrically connected to the quantization interval calculation unit and the analysis unit, and when the candidate quantization interval is greater than or equal to the first threshold value, sets the value of the second quantization interval to be equal to the first threshold value. The value is the same; and when the candidate quantization interval is smaller than the first threshold value, the value of the second quantization interval is set to be the same as the first quantization interval; and the second quantization interval and the first quantization interval are obtained scale value.
47.根据权利要求46所述的集成电路,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。47. The integrated circuit according to claim 46, wherein, when the analysis unit determines the first threshold value, the first threshold value is restricted to be not greater than the first critical value, but greater than the first quantization interval .
48.根据权利要求47所述的集成电路,其中,该分析单元根据比特压缩情形动态地决定出该第一门限值,而当比特压缩情况未达到预期时,该分析单元将该第一门限值的数值调低。48. The integrated circuit according to claim 47, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit uses the first threshold value The value of the limit value is lowered.
49.根据权利要求46所述的集成电路,其中,该集成电路还包含移位单元,该移位单元与该量化间距决定单元电连接,并根据该量化间距决定单元求出的比例值将所接收到该已译码后的数据做移位。49. The integrated circuit according to claim 46, wherein the integrated circuit further comprises a shift unit, the shift unit is electrically connected to the quantization interval determination unit, and the ratio value obtained by the quantization interval determination unit is used to convert the The decoded data is received and shifted.
50.根据权利要求49所述的集成电路,其中,如果比例值为2,该移位单元则将该已译码后的数据向右移1位,且如果比例值为1,则不进行移位。50. The integrated circuit according to claim 49, wherein if the ratio value is 2, the shift unit shifts the decoded data to the right by 1 bit, and if the ratio value is 1, then does not shift bit.
51.一种集成电路,适用于接收第一比特流,并将该第一比特流转换成第二比特流输出,且该第一比特流是已根据第一量化间距编码后的结果,该集成电路包含:51. An integrated circuit adapted to receive a first bit stream and convert the first bit stream into a second bit stream for output, the first bit stream being the result of encoding according to a first quantization interval, the integrated The circuit contains:
译码单元,用于对该第一比特流译码;a decoding unit, configured to decode the first bit stream;
比特配置单元,用于估计出下一输入单元可使用的比特数;A bit configuration unit, used to estimate the number of bits available for the next input unit;
量化间距计算单元,与该比特配置单元电连接,并根据该比特配置单元估计出的比特数计算候选量化间距;A quantization interval calculation unit is electrically connected to the bit configuration unit, and calculates candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,接收该第一量化间距的值,并设定一个大小等于2倍第一量化间距的第一临界值,且根据该第一临界值和实际使用情形动态地决定出一个第一门限值,且设定一个大小等于4倍第一量化间距的第二临界值,且根据该第二临界值和实际使用情形动态地决定出一个第二门限值;The analysis unit receives the value of the first quantization interval, and sets a first critical value equal to twice the first quantization interval, and dynamically determines a first threshold according to the first critical value and actual usage conditions value, and set a second critical value equal to 4 times the first quantization interval, and dynamically determine a second threshold value according to the second critical value and the actual usage situation;
量化间距决定单元,与该量化间距计算单元及该分析单元电连接,并当该候选量化间距大于或等于该第二门限值时,将该第二量化间距的值设为与该第二临界值相同;当该候选量化间距大于或等于该第一门限值且小于该第二门限值时,将该第二量化间距的值设为与该第一临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设置为与该第一量化间距相同;且得到该第二量化间距与该第一量化间距的比例值;A quantization interval determination unit is electrically connected to the quantization interval calculation unit and the analysis unit, and when the candidate quantization interval is greater than or equal to the second threshold value, sets the value of the second quantization interval to be equal to the second threshold The value is the same; when the candidate quantization interval is greater than or equal to the first threshold value and smaller than the second threshold value, the value of the second quantization interval is set to be the same as the first threshold value; and when the candidate quantization interval When the interval is smaller than the first threshold value, the value of the second quantization interval is set to be the same as the first quantization interval; and the ratio value of the second quantization interval to the first quantization interval is obtained;
移位单元,与该量化间距决定单元及该译码单元电连接,并根据该量化间距决定单元求出的比例值将该译码单元译码后的数据做移位;及a shift unit, electrically connected to the quantization interval determination unit and the decoding unit, and shifts the data decoded by the decoding unit according to the ratio value calculated by the quantization interval determination unit; and
编码单元,与该移位单元电连接,并将该移位单元处理后的数据进行编码以得到该第二比特流。An encoding unit is electrically connected to the shifting unit, and encodes the data processed by the shifting unit to obtain the second bit stream.
52.根据权利要求51所述的集成电路,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。52. The integrated circuit according to claim 51, wherein, when the analysis unit determines the first threshold value, the first threshold value cannot be greater than the first critical value, but must be greater than the first quantization interval .
53.根据权利要求52所述的集成电路,其中,该分析单元根据比特压缩情形动态地决定出该第一门限值,而当比特压缩情况未达到预期时,该分析单元将该第一门限值的数值调低。53. The integrated circuit according to claim 52, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit uses the first threshold The value of the limit value is lowered.
54.根据权利要求53所述的集成电路,其中,该分析单元在决定该第二门限值时,限制该第二门限值不能大于该第二临界值,且也不能小于该第一临界值。54. The integrated circuit according to claim 53, wherein when the analyzing unit determines the second threshold value, the second threshold value is restricted to be neither greater than the second critical value nor less than the first critical value value.
55.根据权利要求51所述的集成电路,其中,如果比例值为4,该移位单元则将译码后的数据向右移2位,如果比例值为2,该移位单元则将译码后的数据向右移1位,且如果比例值为1,则该移位单元不进行移位。55. The integrated circuit according to claim 51, wherein, if the ratio value is 4, the shift unit shifts the decoded data to the right by 2 bits, and if the ratio value is 2, the shift unit shifts the decoded data The coded data is shifted to the right by 1 bit, and if the ratio value is 1, the shift unit does not shift.
56.根据权利要求51所述的集成电路,其中,该比特配置单元是根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比特率、帧率,来估计下一输入单元在编码时可使用的比特数目。56. The integrated circuit according to claim 51, wherein the bit configuration unit is based on the expected target bit rate, the input unit size to be processed, and the original bit rate and frame rate included in the first bit stream, to estimate the number of bits available for encoding the next input unit.
57.一种集成电路,适用于接收一第一比特流译码后的数据,且该第一比特流是已根据第一量化间距编码后的结果,该集成电路包含:57. An integrated circuit adapted to receive decoded data of a first bitstream that has been encoded according to a first quantization interval, the integrated circuit comprising:
比特配置单元,用于估计出下一输入单元可使用的位数;A bit configuration unit, used to estimate the number of bits that can be used by the next input unit;
量化间距计算单元,与该比特配置单元电连接,并根据该比特配置单元估计出的位数计算候选量化间距;A quantization interval calculation unit is electrically connected to the bit configuration unit, and calculates candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,用于接收该第一量化间距的值,并设定一个大小等于2倍第一量化间距的第一临界值,且根据该第一临界值和实际使用情形动态地决定出一个第一门限值,且设定一个大小等于4倍第一量化间距的第二临界值,且根据该第二临界值和实际使用情形动态地决定出一个第二门限值;The analysis unit is configured to receive the value of the first quantization interval, set a first critical value equal to twice the first quantization interval, and dynamically determine a first critical value according to the first critical value and actual usage conditions. A threshold value, and setting a second critical value equal to 4 times the first quantization interval, and dynamically determining a second threshold value according to the second critical value and actual usage conditions;
量化间距决定单元,与该量化间距计算单元及该分析单元电连接,并当该候选量化间距大于或等于该第二门限值时,将该第二量化间距的值设置为与该第二临界值相同;当该候选量化间距大于或等于该第一门限值且小于该第二门限值时,将该第二量化间距的值设置为与该第一临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设置为与该第一量化间距相同;且得到该第二量化间距与该第一量化间距的比例值。A quantization interval determination unit is electrically connected to the quantization interval calculation unit and the analysis unit, and when the candidate quantization interval is greater than or equal to the second threshold value, sets the value of the second quantization interval to be equal to the second threshold The value is the same; when the candidate quantization interval is greater than or equal to the first threshold value and smaller than the second threshold value, the value of the second quantization interval is set to be the same as the first threshold value; and when the candidate quantization interval When the interval is smaller than the first threshold value, the value of the second quantization interval is set to be the same as the first quantization interval; and a ratio value of the second quantization interval to the first quantization interval is obtained.
58.根据权利要求57所述的集成电路,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。58. The integrated circuit according to claim 57, wherein, when the analysis unit determines the first threshold value, the first threshold value is restricted to be not greater than the first critical value, but greater than the first quantization interval .
59.根据权利要求58所述的集成电路,其中,该分析单元根据比特压缩情形动态地决定出该第一门限值,而当比特压缩情况未达到预期时,则该分析单元将该第一门限值的数值调低。59. The integrated circuit according to claim 58, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit sets the first threshold value to The value of the threshold value is lowered.
60.根据权利要求59所述的集成电路,其中,该分析单元在决定该第二门限值时,限制该第二门限值不能大于该第二临界值,且也不能小于该第一临界值。60. The integrated circuit according to claim 59, wherein when the analyzing unit determines the second threshold value, the second threshold value is restricted to be neither greater than the second critical value nor less than the first critical value value.
61.根据权利要求57所述的集成电路,其中,该集成电路还包含移位单元,该移位单元与该量化间距决定单元电连接,并根据该量化间距决定单元求出的比例值将所接收到该已译码后的数据做移位。61. The integrated circuit according to claim 57, wherein the integrated circuit further comprises a shift unit, the shift unit is electrically connected to the quantization interval determination unit, and the ratio value obtained by the quantization interval determination unit is used to convert the The decoded data is received and shifted.
62.根据权利要求61所述的集成电路,其中,如果比例值为4,该移位单元则将该已译码后的数据向右移2位,如果比例值为2,该移位单元则将该已译码后的数据向右移1位,且如果比例值为1,该移位单元不进行移位。62. The integrated circuit according to claim 61, wherein, if the ratio value is 4, the shift unit shifts the decoded data to the right by 2 bits, and if the ratio value is 2, the shift unit then The decoded data is shifted to the right by 1 bit, and if the ratio value is 1, the shift unit does not shift.
63.一种集成电路,适用于接收第一比特流,并将该第一比特流转换成第二比特流输出,且该第一比特流是已根据第一量化间距编码后的结果,该集成电路包含:63. An integrated circuit adapted to receive a first bit stream and convert the first bit stream into a second bit stream for output, the first bit stream being encoded according to a first quantization interval, the integrated The circuit contains:
译码单元,用于对该第一比特流译码;a decoding unit, configured to decode the first bit stream;
反量化单元,与该译码单元电连接,并将该译码单元译码后的数据以该第一量化间距进行反量化;An inverse quantization unit is electrically connected to the decoding unit, and dequantizes the data decoded by the decoding unit at the first quantization interval;
比特配置单元,用于估计出下一输入单元可使用的比特数;A bit configuration unit, used to estimate the number of bits available for the next input unit;
量化间距计算单元,与该比特配置单元电连接,并根据该比特配置单元估计出的比特数计算候选量化间距;A quantization interval calculation unit is electrically connected to the bit configuration unit, and calculates candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,用于接收该第一量化间距的值,并分析比特比例与量化间距的关系,以判断出一个第一临界值,且根据实际使用情形及该第一临界值决定出一个第一门限值,而决定出该第一临界值的方式是将该第一临界值的数值设置为与在第二大等级的比特比例范围中具有最小值的量化间距相同,但如果该第一临界值在此设定下小于2倍第一量化间距,将该第一临界值直接改设为与2倍第一量化间距的值相同;及An analysis unit, configured to receive the value of the first quantization interval, and analyze the relationship between the bit ratio and the quantization interval to determine a first critical value, and determine a first gate according to the actual use situation and the first critical value limit, and the first threshold is determined by setting the value of the first threshold to be the same as the quantization pitch that has the smallest value in the bit scale range of the second largest level, but if the first threshold Under this setting, it is less than 2 times the first quantization interval, and the first critical value is directly changed to be the same as the value of 2 times the first quantization interval; and
量化间距决定单元,与该分析单元及该量化间距计算单元电连接,并当该候选量化间距大于或等于该第一门限值时,将该第二量化间距的值设置为与该第一临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设置为与该第一量化间距相同;A quantization interval determination unit is electrically connected to the analysis unit and the quantization interval calculation unit, and when the candidate quantization interval is greater than or equal to the first threshold value, the value of the second quantization interval is set to be equal to the value of the first threshold The values are the same; and when the candidate quantization interval is smaller than the first threshold value, the value of the second quantization interval is set to be the same as the first quantization interval;
量化单元,与该量化间距决定单元及该反量化单元电连接,并根据该量化间距决定单元决定出的第二量化间距,对由该反量化单元反量化后的数据进行量化;及A quantization unit is electrically connected to the quantization interval determination unit and the inverse quantization unit, and quantizes the data dequantized by the inverse quantization unit according to the second quantization interval determined by the quantization interval determination unit; and
编码单元,与该量化单元电连接,并对该量化单元量化后的数据进行编码以得到该第二比特流。The encoding unit is electrically connected to the quantization unit, and encodes the quantized data of the quantization unit to obtain the second bit stream.
64.根据权利要求63所述的集成电路,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。64. The integrated circuit according to claim 63, wherein, when the analysis unit determines the first threshold value, the first threshold value cannot be greater than the first critical value, but must be greater than the first quantization interval .
65.根据权利要求64所述的集成电路,其中,该分析单元根据比特压缩情形动态地决定出该第一门限值,而当比特压缩情况未达到预期时,该分析单元将该第一门限值的数值调低。65. The integrated circuit according to claim 64, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit uses the first threshold value The value of the limit value is lowered.
66.根据权利要求63所述的集成电路,其中,该比特配置单元根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比率、帧率,来估计下一输入单元在编码时可使用的比特数目。66. The integrated circuit according to claim 63, wherein the bit configuration unit estimates according to the expected target bit rate, the input unit size to be processed, and the original rate and frame rate contained in the first bit stream The number of bits available for encoding the next input unit.
67.一种集成电路,适用于接收第一比特流译码后的数据,且该第一比特流是已根据第一量化间距编码后的结果,该集成电路包含:67. An integrated circuit adapted to receive data decoded from a first bitstream that has been encoded according to a first quantization pitch, the integrated circuit comprising:
比特配置单元,用于估计出下一输入单元可使用的比特数;A bit configuration unit, used to estimate the number of bits available for the next input unit;
量化间距计算单元,与该比特配置单元电连接,并根据该比特配置单元估计出的比特数计算候选量化间距;A quantization interval calculation unit is electrically connected to the bit configuration unit, and calculates candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,用于接收该第一量化间距的值,并分析比特比例与量化间距的关系,以判断出一个第一临界值,且根据实际使用情形及该第一临界值决定出一个第一门限值,而决定出该第一临界值的方式是将该第一临界值的数值设为与在第二大等级的比特比例范围中具有最小值的量化间距相同,但如果该第一临界值在此设定下小于2倍第一量化间距,将该第一临界值直接改设为与2倍第一量化间距的值相同;及An analysis unit, configured to receive the value of the first quantization interval, and analyze the relationship between the bit ratio and the quantization interval to determine a first critical value, and determine a first gate according to the actual use situation and the first critical value limit, and the first threshold is determined by setting the value of the first threshold to be the same as the quantization interval that has the smallest value in the bit scale range of the second largest level, but if the first threshold Under this setting, it is less than 2 times the first quantization interval, and the first critical value is directly changed to be the same as the value of 2 times the first quantization interval; and
量化间距决定单元,与该分析单元及该量化间距计算单元电连接,并当该候选量化间距大于或等于该第一门限值时,将该第二量化间距的值设置为与该第一临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设置为与该第一量化间距相同。A quantization interval determination unit is electrically connected to the analysis unit and the quantization interval calculation unit, and when the candidate quantization interval is greater than or equal to the first threshold value, the value of the second quantization interval is set to be equal to the value of the first threshold The values are the same; and when the candidate quantization interval is smaller than the first threshold value, the value of the second quantization interval is set to be the same as the first quantization interval.
68.根据权利要求67所述的集成电路,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。68. The integrated circuit according to claim 67, wherein, when the analysis unit determines the first threshold value, the first threshold value cannot be greater than the first critical value, but must be greater than the first quantization interval .
69.根据权利要求68所述的集成电路,其中,该分析单元根据比特压缩情形来动态地决定出该第一门限值,而当比特压缩情况未达到预期时,该分析单元将该第一门限值的数值调低。69. The integrated circuit according to claim 68, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit uses the first threshold The value of the threshold value is lowered.
70.一种集成电路,适用于接收第一比特流,并将该第一比特流转换成第二比特流输出,且该第一比特流是已根据一第一量化间距编码后的结果,该集成电路包含:70. An integrated circuit adapted to receive a first bit stream and convert the first bit stream into a second bit stream for output, the first bit stream being encoded according to a first quantization interval, the Integrated circuits include:
译码单元,用于对该第一比特流译码;a decoding unit, configured to decode the first bit stream;
反量化单元,与该译码单元电连接,并将该译码单元译码后的数据以该第一量化间距进行反量化;An inverse quantization unit is electrically connected to the decoding unit, and dequantizes the data decoded by the decoding unit at the first quantization interval;
比特配置单元,用于估计出下一输入单元可使用的比特数;A bit configuration unit, used to estimate the number of bits available for the next input unit;
量化间距计算单元,与该比特配置单元电连接,并根据该比特配置单元估计出的比特数计算候选量化间距;A quantization interval calculation unit is electrically connected to the bit configuration unit, and calculates candidate quantization intervals according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,接收该第一量化间距的值,并分析比特比例与量化间距的关系,以判断出一个第一临界值和一个第二临界值,且根据实际使用情形及分别根据该第一临界值和该第二临界值决定出一个第一门限值和一个第二门限值,而决定出该第一临界值的方式是将该第一临界值的数值设置为与在第二大等级的比特比例范围中具有最小值的量化间距相同,但如果该第一临界值在此设定下小于2倍第一量化间距,则将该第一临界值直接改设为与2倍第一量化间距的值相同;而判断是否有该第二临界值的方式是判断该比特比例与量化间距的关系中,是否存在有另一等级的比特比例,且此另一等级的比特比例小于该第一临界值所在的等级,如果有,则表示该第二临界值存在,则设该第二临界值为与在此较低等级的比特比例范围中具有最小值的量化间距相同;及The analysis unit receives the value of the first quantization interval, and analyzes the relationship between the bit ratio and the quantization interval to determine a first critical value and a second critical value, and according to the actual use situation and respectively according to the first critical value and the second threshold value to determine a first threshold value and a second threshold value, and the way to determine the first threshold value is to set the value of the first threshold value to be the same as that at the second largest level The quantization pitch with the smallest value in the bit ratio range is the same, but if the first critical value is smaller than 2 times the first quantization pitch under this setting, then the first critical value is directly changed to be 2 times the first quantization pitch The value is the same; and the way to judge whether there is the second critical value is to judge whether there is another level of bit ratio in the relationship between the bit ratio and the quantization interval, and the bit ratio of this other level is smaller than the first critical value the level at which the value is located, if any, indicating that the second critical value exists, then let the second critical value be the same as the quantization interval having the smallest value in the bit scale range of this lower level; and
量化间距决定单元,与该分析单元及该量化间距计算单元电连接,并当该候选量化间距大于或等于该第一门限值且小于该第二门限值时,将该第二量化间距的值设置为与该第一临界值相同;且当该候选量化间距大于该第二门限值时,将该第二量化间距的值设为与该第二临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设置为与该第一量化间距相同;A quantization interval determination unit is electrically connected to the analysis unit and the quantization interval calculation unit, and when the candidate quantization interval is greater than or equal to the first threshold value and smaller than the second threshold value, the second quantization interval The value is set to be the same as the first critical value; and when the candidate quantization interval is greater than the second threshold value, the value of the second quantization interval is set to be the same as the second critical value; and when the candidate quantization interval When it is less than the first threshold value, the value of the second quantization interval is set to be the same as the first quantization interval;
量化单元,与该量化间距决定单元及该反量化单元电连接,并根据该量化间距决定单元决定出的第二量化间距,对由该反量化单元反量化后的数据进行量化;及A quantization unit is electrically connected to the quantization interval determination unit and the inverse quantization unit, and quantizes the data dequantized by the inverse quantization unit according to the second quantization interval determined by the quantization interval determination unit; and
编码单元,与该量化单元电连接,并将该量化单元量化后的数据进行编码以得到该第二比特流。The encoding unit is electrically connected to the quantization unit, and encodes the quantized data of the quantization unit to obtain the second bit stream.
71.根据权利要求70所述的集成电路,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。71. The integrated circuit according to claim 70, wherein when the analyzing unit determines the first threshold value, the first threshold value cannot be greater than the first critical value, but must be greater than the first quantization interval .
72.根据权利要求71所述的集成电路,其中,该分析单元是根据比特压缩情形来动态地决定出该第一门限值,而当比特压缩情况未达到预期时,该分析单元将该第一门限值的数值调低。72. The integrated circuit according to claim 71, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit sets the first threshold value to A numerical value of the threshold value is lowered.
73.根据权利要求72所述的集成电路,其中,该分析单元在决定该第二门限值时,限制该第二门限值不能大于该第二临界值,且也不能小于该第一临界值。73. The integrated circuit according to claim 72, wherein when the analyzing unit determines the second threshold value, the second threshold value is restricted to be neither greater than the second critical value nor less than the first critical value value.
74.根据权利要求70所述的集成电路,其中,该比特配置单元根据预期的目标比特率、要处理的输入单位大小,及该第一比特流中所包含的原始比特率、帧率,来估计下一输入单元在编码时可使用的比特数目。74. The integrated circuit according to claim 70, wherein the bit configuration unit is configured according to the expected target bit rate, the input unit size to be processed, and the original bit rate and frame rate included in the first bit stream Estimates the number of bits available for encoding the next input unit.
75.一种集成电路,适用于接收第一比特流译码后的数据,且该第一比特流是已根据第一量化间距编码后的结果,该集成电路包含:75. An integrated circuit adapted to receive data decoded from a first bitstream that has been encoded according to a first quantization pitch, the integrated circuit comprising:
比特配置单元,用于估计出下一输入单元可使用的比特数;A bit configuration unit, used to estimate the number of bits available for the next input unit;
量化间距计算单元,与该比特配置单元电连接,并根据该比特配置单元估计出的比特数计算一候选量化间距;A quantization distance calculation unit is electrically connected to the bit configuration unit, and calculates a candidate quantization distance according to the number of bits estimated by the bit configuration unit;
量化间距调整器,包括:Quantization spacing adjusters, including:
分析单元,用于接收该第一量化间距的值,并分析比特比例与量化间距的关系,以判断出一个第一临界值和一个第二临界值,且根据实际使用情形及分别根据该第一临界值和该第二临界值决定出一个第一门限值和一个第二门限值,而决定出该第一临界值的方式是将该第一临界值的数值设置为与在第二大等级的比特比例范围中具有最小值的量化间距相同,但如果该第一临界值在此设定下小于2倍第一量化间距,则将该第一临界值直接改设为与2倍第一量化间距的值相同;而判断是否有该第二临界值的方式是判断该比特比例与量化间距的关系中,是否存在有另一等级的比特比例,且此另一等级的比特比例小于该第一临界值所在的等级,如果有,则表示该第二临界值存在,则设该第二临界值为与在此较低等级的比特比例范围中具有最小值的量化间距相同;及The analysis unit is used to receive the value of the first quantization interval, and analyze the relationship between the bit ratio and the quantization interval to determine a first critical value and a second critical value, and according to the actual use situation and respectively according to the first The critical value and the second critical value determine a first threshold value and a second threshold value, and the way to determine the first critical value is to set the value of the first critical value to be equal to the second largest threshold value The quantization interval with the smallest value in the bit scale range of the level is the same, but if the first critical value is smaller than 2 times the first quantization interval under this setting, then the first critical value is directly changed to be the same as 2 times the first The value of the quantization distance is the same; and the way to judge whether there is the second critical value is to judge whether there is another level of bit proportion in the relationship between the bit ratio and the quantization distance, and the bit ratio of this other level is smaller than the first The level at which a threshold is located, if any, indicates that the second threshold exists, and the second threshold is assumed to be the same as the quantization interval having the smallest value in the bit scale range of this lower level; and
量化间距决定单元,与该分析单元及该量化间距计算单元电连接,并当该候选量化间距大于或等于该第一门限值且小于该第二门限值时,将该第二量化间距的值设置为与该第一临界值相同;且当该候选量化间距大于该第二门限值时,将该第二量化间距的值设置为与该第二临界值相同;且当该候选量化间距小于该第一门限值时,将该第二量化间距的值设置为与该第一量化间距相同。A quantization interval determination unit is electrically connected to the analysis unit and the quantization interval calculation unit, and when the candidate quantization interval is greater than or equal to the first threshold value and smaller than the second threshold value, the second quantization interval The value is set to be the same as the first critical value; and when the candidate quantization interval is greater than the second threshold value, the value of the second quantization interval is set to be the same as the second critical value; and when the candidate quantization interval When it is smaller than the first threshold value, set the value of the second quantization interval to be the same as the first quantization interval.
76.根据权利要求75所述的集成电路,其中,该分析单元在决定该第一门限值时,限制该第一门限值不能大于该第一临界值,但需大于该第一量化间距。76. The integrated circuit according to claim 75, wherein, when the analysis unit determines the first threshold value, the first threshold value cannot be greater than the first critical value, but must be greater than the first quantization interval .
77.根据权利要求76所述的集成电路,其中,该分析单元根据比特压缩情形动态地决定出该第一门限值,而当比特压缩情况未达到预期时,该分析单元将该第一门限值的数值调低。77. The integrated circuit according to claim 76, wherein the analysis unit dynamically determines the first threshold value according to the bit compression situation, and when the bit compression situation does not meet expectations, the analysis unit uses the first threshold The value of the limit value is lowered.
78.根据权利要求77所述的集成电路,其中,该分析单元在决定该第二门限值时,限制该第二门限值不能大于该第二临界值,且也不能小于该第一临界值。78. The integrated circuit according to claim 77, wherein when the analyzing unit determines the second threshold value, the second threshold value is restricted to be neither greater than the second critical value nor less than the first critical value value.