算术编码(Arithmetic Coding)源代码

 Ian H. Witten、Radford M. Neal和John G. Cleary在1987年发表了一篇启发性的论文。论文中描述了一种基于整数运算的通用算术编码器,而且还给出了由计算错误导致的效率低下的分析。以下源代码来自于这篇论文:《基于算术编码的数据压缩》(Arithmetic Coding For Data Compression)。该论文的下载地址:http://www.sachingarg.com/compression/entropy_coding/acm87_arithmetic_coding.pdf

  编码函数和解码函数的伪代码:

/* ARITHMETIC ENCODING ALGORITHM. */

/* Call encode_symbol repeatedly for each symbol in the message.           */
/* Ensure that a distinguished "terminator" symbol is encoded last, then   */
/* transmit any value in the range [low, high).                            */

encode_symbol(symbo1, cum_freq)
    range = high - low
    high = low + range*cum_freq[symbol-1]
    low   = low + range*cum-freq[symbol]


/* ARITHMETIC DECODING ALGORITHM. */

/* "Value" is the number that has been received.                           */
/* Continue calling decode-symbol until the terminator symbol is returned. */

decode_symbol(cum_freq)
    find symbol such that
        cum_freq[symbol] <= (value-low)/(high-low) < cum_freq[symbol-1]
                            /* This ensures that value lies within the new */
                            /* [low, high) range that will be calculated by */
                            /* the following lines of code.                 */

    range = high - low
    high = low + range*cum_freq[symbol-1]
    low   = low + range*cum_freq[symbol]
    return symbol

  算术编码器和解码器的C语言实现:

arithmetic_coding.h
─────────────────────────────────────────
/* DECLARATIONS USED FOR ARITHMETIC ENCODING AND DECODING */


/* SIZE OF ARITHMETIC CODE VALUES. */

#define Code_value_bits 16              /* Number of bits in a code value   */
typedef long code_value;                /* Type of an arithmetic code value */

#define Top_value (((long)1<<Code_value_bits)-1)      /* Largest code value */


/* HALF AND QUARTER POINTS IN THE CODE VALUE RANGE. */

#define First_qtr (Top_value/4+1)       /* Point after first quarter        */
#define Half      (2*First_qtr)         /* Point after first half           */
#define Third_qtr (3*First_qtr)         /* Point after third quarter        */
─────────────────────────────────────────

model.h
─────────────────────────────────────────
/* INTERFACE TO THE MODEL. */

/* THE SET OF SYMBOLS THAT MAY BE ENCODED. */

#define No_of_chars 256                 /* Number of character symbols      */
#define EOF_symbol (No_of_chars+1)      /* Index of EOF symbol              */

#define No_of_symbols (No_of_chars+1)   /* Total number of symbols          */

/* TRANSLATION TABLES BETWEEN CHARACTERS AND SYMBOL INDEXES. */

int char_to_index[No_of_chars];         /* To index from character          */
unsigned char index_to_char[No_of_symbols+1]; /* To character from index    */

/* CUMULATIVE FREQUENCY TABLE. */

#define Max_frequency 16383             /* Maximum allowed frequency count */
                                        /*   2^14 - 1                       */
int cum_freq[No_of_symbols+1];          /* Cumulative symbol frequencies    */
─────────────────────────────────────────

encode.c
─────────────────────────────────────────
/* MAIN PROGRAM FOR ENCODING. */

#include <stdio.h>
#include "model.h"

main()
{   start_model();                             /* Set up other modules.     */
    start_outputing_bits();
    start_encoding();
    for (;;) {                                 /* Loop through characters. */
        int ch; int symbol;
        ch = getc(stdin);                      /* Read the next character. */
        if (ch==EOF) break;                    /* Exit loop on end-of-file. */
        symbol = char_to_index[ch];            /* Translate to an index.    */
        encode_symbol(symbol,cum_freq);        /* Encode that symbol.       */
        update_model(symbol);                  /* Update the model.         */
    }
    encode_symbol(EOF_symbol,cum_freq);        /* Encode the EOF symbol.    */
    done_encoding();                           /* Send the last few bits.   */
    done_outputing_bits();
    exit(0);
}
─────────────────────────────────────────

arithmetic_encode.c
─────────────────────────────────────────
/* ARITHMETIC ENCODING ALGORITHM. */

#include "arithmetic_coding.h"

static void bit_plus_follow();   /* Routine that follows                    */

/* CURRENT STATE OF THE ENCODING. */

static code_value low, high;    /* Ends of the current code region          */
static long bits_to_follow;     /* Number of opposite bits to output after */
                                /* the next bit.                            */

/* START ENCODING A STREAM OF SYMBOLS. */

start_encoding()
{   low = 0;                            /* Full code range.                 */
    high = Top_value;
    bits_to_follow = 0;                 /* No bits to follow next.          */
}

/* ENCODE A SYMBOL. */

encode_symbol(symbol,cum_freq)
    int symbol;                 /* Symbol to encode                         */
    int cum_freq[];             /* Cumulative symbol frequencies            */
{   long range;                 /* Size of the current code region          */
    range = (long)(high-low)+1;
    high = low +                                /* Narrow the code region   */
      (range*cum_freq[symbol-1])/cum_freq[0]-1; /* to that allotted to this */
    low = low +                                 /* symbol.                  */
      (range*cum_freq[symbol])/cum_freq[0];
    for (;;) {                                  /* Loop to output bits.     */
        if (high<Half) {
            bit_plus_follow(0);                 /* Output 0 if in low half. */
        }
        else if (low>=Half) {                   /* Output 1 if in high half.*/
            bit_plus_follow(1);
            low -= Half;
            high -= Half;                       /* Subtract offset to top. */
        }
        else if (low>=First_qtr                 /* Output an opposite bit   */
              && high<Third_qtr) {              /* later if in middle half. */
            bits_to_follow += 1;
            low -= First_qtr;                   /* Subtract offset to middle*/
            high -= First_qtr;
        }
        else break;                             /* Otherwise exit loop.     */
        low = 2*low;
        high = 2*high+1;                        /* Scale up code range.     */
    }
}

/* FINISH ENCODING THE STREAM. */

done_encoding()
{   bits_to_follow += 1;                       /* Output two bits that      */
    if (low<First_qtr) bit_plus_follow(0);     /* select the quarter that   */
    else bit_plus_follow(1);                   /* the current code range    */
}                                              /* contains.                 */

/* OUTPUT BITS PLUS FOLLOWING OPPOSITE BITS. */

static void bit_plus_follow(bit)
    int bit;
{   output_bit(bit);                           /* Output the bit.           */
    while (bits_to_follow>0) {
        output_bit(!bit);                      /* Output bits_to_follow     */
        bits_to_follow -= 1;                   /* opposite bits. Set        */
    }                                          /* bits_to_follow to zero.   */
}
─────────────────────────────────────────

decode.c
─────────────────────────────────────────
/* MAIN PROGPAM FOR DECODING. */

#include <stdio.h>
#include "model.h"

main ()
{   start_model();                              /* Set up other modules.    */
    start_inputing_bits();
    start_decoding();
    for (;;) {                                  /* Loop through characters. */
        int ch; int symbol;
        symbol = decode_symbol(cum_freq);       /* Decode next symbol.      */
        if (symbol==EOF_symbol) break;          /* Exit loop if EOF symbol. */
        ch = index_to_char[symbol];             /* Translate to a character.*/
        putc(ch,stdout);                        /* Write that character.    */
        update_model(symbol);                   /* Update the model.        */
    }
    exit(0);
}
─────────────────────────────────────────

arithmetic_decode.c
─────────────────────────────────────────
/* ARITHMETIC DECODING ALGORITHM. */

#include "arithmetic_coding.h"

/* CURRENT STATE OF THE DECODING. */

static code_value value;        /* Currently-seen code value                */
static code_value low, high;    /* Ends of current code repion              */

/* START DECODING A STREAM OF SYMBOLS. */

start_decoding()
{   int i;
    value = 0;                                  /* Input bits to fill the   */
    for (i = 1; i<=Code_value_bits; i++) {      /* code value.              */
        value = 2*value+input_bit();
    }
    low = 0;                                    /* Full code range.         */
    high = Top_value;
}

/* DECODE THE NEXT SYMBOL. */

int decode_symbol(cum_freq)
    int cum_freq[];             /* Cumulative symbol frequencies            */
{   long range;                 /* Size of current code region              */
    int cum;                    /* Cumulative frequency calculated          */
    int symbol;                 /* Symbol decoded */
    range = (long)(high-low)+1;
    cum =                                       /* Find cum freq for value. */
      (((long)(value-low)+1)*cum_freq[0]-1)/range;
    for (symbol = 1; cum_freq[symbol]>cum; symbol++) ; /* Then find symbol. */
    high = low +                                /* Narrow the code region   */
      (range*cum_freq[symbol-1])/cum_freq[0]-1; /* to that allotted to this */
    low = low +                                 /* symbol.                  */
      (range*cum_freq[symbol])/cum_freq[0];
    for (;;) {                                  /* Loop to get rid of bits. */
        if (high<Half) {
            /* nothing */                       /* Expand low half.         */
        }
        else if (low>=Half) {                   /* Expand high half.        */
            value -= Half;
            low -= Half;                        /* Subtract offset to top. */
            high -= Half;
        }
        else if (low>=First_qtr                 /* Expand middle half.      */
              && high<Third_qtr) {
            value -= First_qtr;
            low -= First_qtr;                   /* Subtract offset to middle*/
            high -= First_qtr;
        }
        else break;                             /* Otherwise exit loop.     */
        low = 2*low;
        high = 2*high+1;                        /* Scale up code range.     */
        value = 2*value+input_bit();            /* Move in next input blt. */
    }
    return symbol;
}

bit_input.c
─────────────────────────────────────────
/* BIT INPUT ROUTINES. */

#include <stdio.h>
#include "arithmetic_coding.h"

/* THE BIT BUFFER. */

static int buffer;              /* Bits waiting to be input                 */
static int bits_to_go;          /* Number of bits still in buffer           */
static int garbage_bits;        /* Number of bits past end-of-file          */

/* INITIALIZE BIT INPUT. */

start_inputing_bits()
{   bits_to_go = 0;                             /* Buffer starts out with   */
    garbage_bits = 0;                           /* no bits in it.           */
}

/* INPUT A BIT. */

int input_bit()
{   int t;
    if (bits_to_go==0) {                        /* Read the next byte if no */
        buffer = getc(stdin);                   /* bits are left in buffer. */
        if (buffer==EOF) {
            garbage_bits += 1;                      /* Return arbitrary bits*/
            if (garbage_bits>Code_value_bits-2) {   /* after eof, but check */
                fprintf(stderr,"Bad input file/n"); /* for too many such.   */
                exit(-1);
            }
        }
        bits_to_go = 8;
    }
    t = buffer&1;                               /* Return the next bit from */
    buffer >>= 1;                               /* the bottom of the byte. */
    bits_to_go -= 1;
    return t;
}
─────────────────────────────────────────

bit_output.c
─────────────────────────────────────────
/* BIT OUTPUT ROUTINES. */

#include <stdio.h>

/* THE BIT BUFFER. */

static int buffer;               /* Bits buffered for output                */
static int bits_to_go;           /* Number of bits free in buffer           */

/* INITIALIZE FOR BIT OUTPUT. */

start_outputing_bits()
{   buffer = 0;                                 /* Buffer is empty to start */
    bits_to_go = 8;                             /* with.                    */
}

/* OUTPUT A BIT. */

output_bit(bit)
    int bit;
{   buffer >>= 1;                               /* Put bit in top of buffer.*/
    if (bit) buffer |= 0x80;
    bits_to_go -= 1;
    if (bits_to_go==0) {                        /* Output buffer if it is   */
        putc(buffer,stdout);                    /* now full.                */
        bits_to_go = 8;
    }
}

/* FLUSH OUT THE LAST BITS. */

done_outputing_bits()
{   putc(buffer>>bits_to_go,stdout);
}
─────────────────────────────────────────

  静态模型和自适应模型的程序调用:

fixed_model.c
─────────────────────────────────────────
/* THE FIXED SOURCE MODEL */

#include "model.h"

int freq[No_of_symbols+1] = (
   0,
   1,   1,   1,   1,   1,   1,   1,   1,   1,   1, 124,   1,   1,   1,   1,   1,
   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,

/*      !    "    #    $    %    &    '    (    )    *    +    ,    -    .    / */
1236,   1, 21,   9,   3,   1, 25, 15,   2,   2,   2,   1, 79, 19, 60,   1,

/* 0    1    2    3    4    5    6    7    8    9    :    ;    <    =    >    ? */
15, 15,   8,   5,   4,   7,   5,   4,   4,   6,   3,   2,   1,   1,   1,   1,

/* @    A    B    C    D    E    F    G    H    I    J    K    L    M    N    O */
   1, 24, 15, 22, 12, 15, 10,   9, 16, 16,   8,   6, 12, 23, 13, 11,

/* P    Q    R    S    T    U    V    W    X    Y    Z    [    /    ]    ^    _ */
14,   1, 14, 28, 29,   6,   3, 11,   1,   3,   1,   1,   1,   1,   1,   3,

/* '    a    b    c    d    e    f    g    h    i    j    k    l    m    n    o */
   1, 491, 85, 173, 232, 744, 127, 110, 293, 418,   6, 39, 250, 139, 429, 446,

/* p    q    r    s    t    u    v    w    x    y    z    {    |    }    ~      */
111,   5, 388, 375, 531, 152, 57, 97, 12, 101,   5,   2,   1,   2,   3,   1,

   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
   1
};

/* INITIALIZE THE MODEL. */

start_model()
{   int 1;
    for (i = 0; i<No_of_chars; i++) {           /* Set up tables that       */
        char_to_index[i] = i+1;                 /* translate between symbol */
        index_to_char[i+1] = i;                 /* indexes and characters. */
    }
    cum_freq[No_of_symbols] = 0;
    for (i = No_of_symbols; i>0; i--) {        /* Set up cumulative        */
        cum_freq[i-1] = cum_freq[i] + freq[i]; /* frequency counts.        */
    }
    if (cum_freq[0] > Max_frequency) abort();   /* Check counts within limit*/
}

/* UPDATE THE MODEL TO ACCOUNT FOR A NEW SYMBOL. */

update_model(symbol)
    int symbol;
{                                               /* Do nothing. */
}
─────────────────────────────────────────

adaptive_model.c
─────────────────────────────────────────
/* THE ADAPTIVE SOURCE MODEL */

#include "modol.h"

int freq[No_of_symbols+1];       /* symbol frequencies                      */

/* INITIALIZE THE MODEL. */

start_model()
{   int i;
    for (i = 0; i<No_of_chars; i++) {           /* Set up tables that       */
        char_to_index[i] = i+1;                 /* translate between symbol */
        index_to_char[i+1] = i;                 /* indexes and characters. */
    }
    for (i = 0; i<=No_of_symbols; i++) {        /* Set up initial frequency */
        freq[i] = 1;                            /* counts to be one for all */
        cum_freq[i] = No_of_symbols-i;          /* symbols.                 */
    }
    freq[0] = 0;                                /* Freq[0] must not be the */
}                                               /* same as freq[1].         */

/* UPDATE THE MODEL TO ACCOUNT FOR A NEW SYMBOL. */

update_model(symbol)
    int symbol;                 /* Index of new symbol                      */
{   int i;                      /* New index for symbol                     */
    if (cum_freq[0]==Max_frequency) {           /* See if frequency counts */
        int cum;                                /* are at their maximum.    */
        cum = 0;
        for (i = No_of_symbols; i>=0; i--) {    /* If so, halve all the     */
            freq[i] = (freq[i]+1)/2;            /* counts (keeping them     */
            cum_freq[i] = cum;                  /* non-zero).               */
            cum += freq[i];
        }
    }
    for (i = symbol; freq[i]==freq[i-1]; i--) ; /* Find symbol's new index. */
    if (i<symbol) {
        int ch_i, ch_symbol;
        ch_i = index_to_char[i];                /* Update the translation   */
        ch_symbol = index_to_char[symbol];      /* tables if the symbol has */
        index_to_char[i] = ch_symbol;           /* moved.                   */
        index_to_char[symbol] = ch_i;
        char_to_index[ch_i] = symbol;
        char_to_index[ch_symbol] = i;
    }
    freq[i] += 1;
    while (i>0) {                               /* Increment the frequency */
        i -= 1;                                 /* count for the symbol and */
        cum_freq[i] += 1;                       /* update the cumulative    */
    }                                           /* frequencies.             */
}

 

 

 

 

 

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/456186.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

pandas读写各种类型数据

read_X()通常是pandas模块下的&#xff0c;to_X()是dataframe的方法 CSV 读取 使用pandas.read_csv()方法&#xff0c;返回的是一个dataframe csv默认是以"&#xff0c;"分割的 csv文件内容 1、read_csv()默认以第一行数据作为标题 2、调用dataframe的head()方法…

python 类装饰器

1 装饰器无参数 class tracer: def __init__(self,func): self.calls 0 self.func func def __call__(self,*args): self.calls 1 print(call %s to %s %(self.calls, self.func.__name__)) self.func(*args) tracer def spam(a, b, c): print(a b c) …

【数据分析】使用pandas和numpy分析美国大选献金项目

1. 数据载入与总览 1.1 数据加载 #绘图工具 import matplotlib.pyplot as plt %matplotlib inline #数据处理工具 import numpy as np import pandas as pd from pandas import Series,DataFrame#数据路径自己指定&#xff0c;本案例数据路径就在当前文件夹下面子文件夹usa_e…

《容器技术系列》一1.4 Docker运行案例分析

本节书摘来华章计算机《容器技术系列》一书中的第1章 &#xff0c;第1.4节&#xff0c;孙宏亮 著, 更多章节内容可以访问云栖社区“华章计算机”公众号查看。 1.4 Docker运行案例分析 1.3节着重介绍了Docker架构中各个模块的功能&#xff0c;学完后我们可以对Docker的架构有一…

算术编码的原理与分析

转自&#xff1a;http://kulasuki115.blogcn.com/diary,201492702.shtml 前言 人类已进入信息时代&#xff0c;信息时代的重要特征是信息的数字化&#xff0c;人们越来越依靠计算机获取和利用信息&#xff0c;这就需要对信息的表示、存储、传输和处理等关键技术进行研究。我们…

3月22日AM

看了思维章节精讲视频课&#xff0c;并且总结了部分思维章节内容转载于:https://www.cnblogs.com/bgd140206102/p/6601440.html

阿里巴巴Dubbo实现的源码分析

Dubbo概述Dubbo是阿里巴巴开源出来的一个分布式服务框架&#xff0c;致力于提供高性能和透明化的RPC远程服务调用方案&#xff0c;以及作为SOA服务治理的方案。它的核心功能包括&#xff1a; remoting:远程通讯基础&#xff0c;提供对多种NIO框架抽象封装&#xff0c;包括“同步…

POJ 2106-Boolean Expressions,双栈运用类似表达式求值!

Boolean Expressions 首先声明此题后台可能极水&#xff08;毕竟这种数据不好造&#xff01;&#xff09;。昨天写了一天却总是找不到bug&#xff0c;讨论区各种数据都过了&#xff0c;甚至怀疑输入有问题&#xff0c;但看到gets也可以过&#xff0c;难道是思路错了&#xff1f…

H264 CAVLC 研究

目录 1 CAVLC概念 2 CAVLC原理 3 CAVLC编码流程 4 CAVLC解码流程 展开全部 1 CAVLC概念 2 CAVLC原理 3 CAVLC编码流程 4 CAVLC解码流程 收起 摘要纠错编辑摘要 CAVLC即基于上下文的自适应变长编码。H.264标准中使用CAVLC对4*4模块的亮度和色度残差数据进行编码。 CAVLC-CAVLC…

【MySQL 】学习笔记千行总结

/* Windows服务 */ -- 启动MySQLnet start mysql -- 创建Windows服务sc create mysql binPath mysqld_bin_path(注意&#xff1a;等号与值之间有空格)/* 连接与断开服务器 */ mysql -h 地址 -P 端口 -u 用户名 -p 密码SHOW PROCESSLIST -- 显示哪些线程正在运行 SHOW VARIABLES…

CCCC 连续因子

题意&#xff1a; 一个正整数N的因子中可能存在若干连续的数字。例如630可以分解为3*5*6*7&#xff0c;其中5、6、7就是3个连续的数字。给定任一正整数N&#xff0c;要求编写程序求出最长连续因子的个数&#xff0c;并输出最小的连续因子序列。 输入格式&#xff1a; 输入在一行…

Mybatis怎么能看是否执行了sql语句

项目需要学习mybatis中&#xff0c;本来mybatis也不是什么新技术&#xff0c;无奈之前没接触过。 验证缓存机制时&#xff0c;需要能看到是否sql被执行了。这就需要增加日志的打印 配置如下 在pom中增加如下依赖&#xff1a; <dependency> <groupId>org.bgee.log4j…

定时备份 MySQL 并上传到七牛

定时备份 MySQL 并上传到七牛 多数应用场景下&#xff0c;我们需要对重要数据进行备份、并放置到一个安全的地方&#xff0c;以备不时之需。 常见的 MySQL 数据备份方式有&#xff0c;直接打包复制对应的数据库或表文件(物理备份)、mysqldump 全量逻辑备份、xtrabackup 增量逻辑…

vue_props div赋值props定义变量 templete获取

vue_props div赋值props定义变量 templete获取 <div id"app"> <add v-bind:btn"h"></add> </div> <script> var vm new Vue({ el: #app, data: { h: "hello" }, components: { "add": { …

H.264句法和语法总结 句法元素的分层结构

在 H.264 定义的码流中&#xff0c;句法元素被组织成有层次的结构&#xff0c;分别描述各个层次的信息&#xff0c;如下图所示 在H.264 中&#xff0c;句法元素共被组织成 序列、图像、片、宏块、子宏块五个层次。 在这样的结构中&#xff0c;每一层的头部和它的数据部分形成管…

instanceof 的运用

2019独角兽企业重金招聘Python工程师标准>>> Java 中的instanceof 运算符是用来在运行时指出对象是否是特定类的一个实例。instanceof通过返回一个布尔值来指出&#xff0c;这个对象是否是这个特定类或者是它的子类的一个实例。 用法&#xff1a; result object i…

R 脚本读取汇总 Excel 表格数据

主要用到了 xlsx 和 rJava 包&#xff0c;打开 Excel 文件&#xff0c;读取各表格数据&#xff0c;再写入到汇总表。 下图为处理前的原始数据表格&#xff1a; 下图为处理后的数据&#xff1a; 代码实现 安装&加载包的函数实现。installed.packages() 函数获取所有已安装…

[Grid Layout] Place grid items on a grid using grid-column and grid-row

It’s possible to position a grid item anywhere on a grid track. To do this, let’s specify some grid-template-columns and grid-template-rows, and to the grid items, we’ll pass grid-column and grid-row some numeric values. <!DOCTYPE html> <html l…

【大数据】最新大数据学习路线(完整详细版,含整套教程)

大数据学习路线 java(Java se,javaweb) Linux(shell,高并发架构,lucene,solr) Hadoop(Hadoop,HDFS,Mapreduce,yarn,hive,hbase,sqoop,zookeeper,flume) 机器学习(R,mahout) Storm(Storm,kafka,redis) Spark(scala,spark,spark core,spark sql,spark streaming,spark mllib,spa…

264编码基本概念 FFMpeg的解码流程

下面转自http://topic.csdn.net/u/20081020/16/7156e0b2-dbfb-4b4f-af59-2be04cf9a420.html 的8楼 1、NAL、Slice与frame意思及相互关系 NAL指网络提取层&#xff0c;里面放一些与网络相关的信息Slice是片的意思&#xff0c;264中把图像分成一帧&#xff08;frame&#xff09;…