Smacker Video форматы – Epic Games құралдарымен жасалған, ойындардағы бейнелерге арналған SMK кеңейтімді видео файлы. 2300-нан астам ойында қолданылды.
Ағылшыншамен салыстырыңыз: абзацты басыңыз — түпнұсқа терезеде ашылады. Абзац астындағы EN түймесі оны мәтін ішінде көрсетеді.
Мазмұны
Кіріспе
Цифрлік бейне файл форматы
Digital video file format
Smacker video – Epic Games Tools компаниясы әзірлеген, негізінен бейне ойындардағы толық қозғалысты бейне үшін қолданылатын бейне файл форматы (SMK файл кеңейтімімен). Smacker адаптивті 8 биттік RGB палитрасын қолданады. RAD компаниясының жоғары түс тереңдігіндегі бейне форматы – Bink Video. Smacker форматы контейнер форматын, бейне қысу форматын және дыбыс қысу форматын анықтайды. 1994 жылы жарық көргеннен бері Smacker 2300-ден астам ойында қолданылған. Формат кері инженерия арқылы libavcodec-те іске асырылды. Коммерциялық емес SourceForge жобасы libsmacker 2013 жылы ашық кодты декодерді шығарды.
Smacker video is a video file format (with the SMK file extension) developed by Epic Games Tools, and primarily used for full motion video in video games. Smacker uses an adaptive 8 bit RGB palette. RAD's format for video at higher color depths is Bink Video. The Smacker format specifies a container format, a video compression format, and an audio compression format. Since its release in 1994, Smacker has been used in over 2300 games. The format has been reverse engineered and implemented in libavcodec. A non commercial SourceForge project libsmacker released an open source decoder in 2013.
Файл пішімі (контейнер)
Smacker өзінің контейнер форматын анықтайды. Smacker файлында Smacker бейне трегі және жетіге дейін аудио тректер болуы мүмкін. Әрбір аудио трек бір арналы (моно) немесе екі арналы (стерео) болуы мүмкін, біт тереңдігі 8 бит немесе 16 бит болатын. Аудио қысылмайтын PCM, Smacker Audio форматында қысылған, немесе Smacker-дің жаңа нұсқаларында Bink Audio форматында қысылған болуы мүмкін.
Smacker defines its own container format. A Smacker file can contain a Smacker video track and up to seven audio tracks. Each audio track can have either one channel (mono) or two channels (stereo) with a bit depth of either 8 bit or 16 bit. The audio can either be uncompressed PCM, compressed in the Smacker Audio format, or, in newer versions of Smacker, compressed in the Bink Audio format.
Видео
Smacker видеосы 256 түсті қолдайды, бірақ мөлдірлік қолдауы жоқ. Палитраға негізделген формат болғандықтан, әр кадрда 256 түстен аспауға шектелген, бірақ Smacker видеоларында "палитра ауысуы" арқасында жалпы түстер саны көбірек болуы мүмкін, онда палитра әр кадрда жаңартылады. Бұл әдетте бастапқы видеода 256 түстен көп болса, жақсы көрінетін SMK файлдарына әкеледі. Сығу деңгейі мазмұнға байланысты. Қозғалмайтын немесе аздап қозғалатын кадрлардан тұратын видеоны кодтау, бірінші кадрдан кейін дерлік тегін. Кездейсоқ түстері бар кадрлар бастапқы өлшемнен екі еседен астам болуы мүмкін. Smacker видеосында кадр растрлік сканерлеу ретімен 4×4 блоктарға бөлінеді. Әр блок алты кодтау режимінің бірінде кодталуы мүмкін: өткізіп жіберу, толтыру, моно және үш толық режим. Әр режим бірнеше блок үшін орындалу ұзындығын кодтау схемасында көрсетілуі мүмкін. Өткізіп жіберу режимінде ағымдағы блок шартты түрде алдыңғы кадрдан көшіріледі. Толтыру режимінде ағымдағы блок бір түспен толтырылады. Моно режимінде палитра 256 түстен екі түске дейін қысқартылады. Екі түс те биттік ағынға жазылады және пикселдің қай түсті алу керектігін көрсету үшін пикселге бір бит қолданылады. Моно режимін векторлық кванттау ретінде қарастыруға болады, онда қызыл, жасыл және көк компоненттері бар үш өлшемді вектор екі жазбасы бар бейімделген код кітабы арқылы квантталады. Үш толық режим бар, біреуі Smacker форматының 2-ші нұсқасында көрсетілген, ал қалған екеуі 4-ші нұсқада қосылған. Түпнұсқа толық режимде әр пикселге бір түспен 16 түс жіберіледі, бұл сығылмаған PCM-ге тең. 4-ші нұсқада қосылған екі толық режимде тиісінше 4 және 8 түс блокта қолданылады. 4 түсті режимде 4×4 блок 4 2×2 блокқа бөлінеді, олардың әрқайсысы бір түспен толтырылады. 8 түсті режимде 4×4 блок 8 1×2 блокқа бөлінеді, олардың әрқайсысы бір түспен толтырылады. Бұдан әрі сығу энтропиялық кодтау арқылы жүзеге асырылады, жоғарыда сипатталған процестен туындаған әртүрлі биттік ағын элементтерінің Хаффман кодтауын қолдану арқылы. Төрт бөлек Хаффман кестесі бар, әрқайсысында 16 биттік жазбалар бар: біреуі режимді таңдау, орындалу ұзындығы және толтыру түсі үшін толтыру түсі режимінде, біреуі моно режиміндегі түс индекстері үшін, біреуі моно режиміндегі биттік карта үшін және біреуі толық режимдегі барлық деректер үшін. Әр кесте бейімделетін және файлдың басында бір рет жіберіледі. Бастағыш Хаффман кестелері өздері сығылған: код ағашының жапырақтарындағы 16 биттік мәндер жоғары және төмен байтқа бөлінеді. Әр байт басқа да Хаффман кестесі арқылы сығылады, ол да бастағышта бар.
Smacker video supports 256 colors, but no transparency support. While being a palette based format, which is inherently limited to having not more than 256 colors in each frame, Smacker videos may still contain more colors in total due to "palette rotation", whereby the palette is updated on a per frame basis. This usually results in SMK files that look better if the source video has more than 256 colors. The compression rate depends on the content. The encoding of a video consisting of still or barely moving frames is after the first frame practically free. Frames with random colors might more than double the raw size. In Smacker video, a frame is split into 4×4 blocks in raster scan order. Each block can be coded in one of six coding modes: skip, fill, mono, and three full modes. Each mode can be signaled for multiple blocks in a run length encoding scheme. In skip mode, the current block is copied from the previous frame in a conditional replenishment fashion. In fill mode, the current block is filled with a single color. In mono mode, the palette is locally reduced from 256 colors to two colors. Both colors are written to the bitstream and one bit per pixel is used to indicate which of the two colors a pixel should be. The mono mode can be interpreted as vector quantization, where a three dimensional vector with the components red, green, and blue is quantized using an adaptive codebook with two entries. There are three full modes, one was specified in version 2 of the Smacker format, while the other two were added in version 4. In the original full mode, 16 colors are transmitted, one for each pixel, equivalent to raw uncompressed PCM. The two full modes added in version 4 use 4 and 8 colors in a block, respectively. In the 4 color mode, the 4×4 block is split into four 2×2 blocks, each of which is filled with a solid color. In the 8 color mode, the 4×4 block is split into eight 1×2 blocks, each of which is filled with a solid color. Further compression is achieved by entropy coding using Huffman coding of the various bitstream elements that result from the process above. There are four separate Huffman tables, each with 16 bit entries: one for mode decision, run length, and fill color in fill color mode, one for the color indices in mono mode, one for the bitmap in mono mode, and one for all data in the full mode. Each table is adaptive and transmitted once per file in the header. The Huffman tables in the header are themselves compressed: the 16 bit values in the leaves of the code tree are split into a high byte and a low byte. Each byte is compressed using a Huffman table that is also contained in the header.
Аудио
Smacker аудиосы – Smacker контейнерінде қолданылатын аудио форматтарының бірі. Қысу үшін Дифференциалдық импульстік кодты модуляциялау (DPCM) пайдаланылады. Екі тікелей үлгінің арасындағы айырмашылық Хэффман кодтау арқылы қысылады. Хэффман кестелері әрбір аудио кадр үшін бір рет өзгереді.
Smacker audio is one of the audio formats that can be used in the Smacker container. For compression, Differential pulse code modulation (DPCM) is used. The difference between two successive samples is compressed using Huffman coding. The Huffman tables are adapted once per audio frame.