Code Monkey home page Code Monkey logo

jpeg_encoder-decoder's Introduction

YUV2JPEG

音视频课作业,从原理上实现了把一个RGB格式的frame编码为jpeg格式再解压的过程。

编码器功能

  • RGB2YUV
  • 对UV降采样。采样质量因子scale可以设定。
  • 对YUV三个矩阵分成8*8 的 block(在注释里叫pixel chunk)
  • 对每个block进行DCT变换
  • 对DCT变换结果进行量化

编码器返回一个jpeg_picture类型的结果,包含YUV三个分量的DCT量化结果。

解码器功能:

  • 对三个分量进行反量化
  • 对每个block进行IDCT变换
  • 将8*8的block重新拼成YUV3个矩阵
  • YUV2RGB
  • 保存RGB信息为ppm格式的图片

虽然ffmpeg有现成接口,但可以从原理上理解JPEG的编码过程。 源文件中有详细的英文注释,需要配一下ffmpeg。

jpeg_encoder-decoder's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.