Exercise 2: Encoder / Decoder Framework Goals : Implement basic - - PowerPoint PPT Presentation

exercise 2 encoder decoder framework
SMART_READER_LITE
LIVE PREVIEW

Exercise 2: Encoder / Decoder Framework Goals : Implement basic - - PowerPoint PPT Presentation

Exercise 2: Encoder / Decoder Framework Goals : Implement basic framework for encoder and decoder (without any real data processing) Implement block-wise processing of samples Encoder Operation Read image in PGM format Write data to bitstream


slide-1
SLIDE 1

Exercise 2: Encoder / Decoder Framework

Goals: Implement basic framework for encoder and decoder (without any real data processing) Implement block-wise processing of samples Encoder Operation Read image in PGM format Write data to bitstream (on the basis of square B×B blocks)

image width W and image height H (each as 16-bit value) block size B (as 16-bit value) process B×B blocks in raster-scan order (i.e., block line by block line) write samples of each block in line-by-line order

Decoder Operation Read data from bitstream (on the basis of square B×B blocks as specified above) Write image in PGM format

Heiko Schwarz (Freie Universität Berlin) — Image and Video Coding

slide-2
SLIDE 2

Exercise 2: Encoder / Decoder Framework

Raw Data Format Format used as encoder input and decoder output Gray-level images in PGM format

http://netpbm.sourceforge.net/doc/pgm.html

PGM Header (in ASCII format) The two bytes “P5” followed by whitespace(s) Image width followed by whitespace(s) Image height followed by whitespace(s) Maximum sample value (always 255 in our case) Single whitespace character (typically newline) PGM Data (in binary format) Samples in line-by-line order Each sample (0..255) is represented by one byte

structure of “pgm” files:

P5 // ascii (fixed) width height // ascii 255 // ascii (max. value) <binary data > // binary

binary data: samples in raster-scan order (line by line) each sample is an 8-bit value (byte) with a value between 0 and 255

Heiko Schwarz (Freie Universität Berlin) — Image and Video Coding

slide-3
SLIDE 3

Exercise 2: Encoder / Decoder Framework

Suggested command line parameters

encoder parameters:

>./ encoder

  • i (input) -b (bitstream) [optional
  • ptions]

required parameters :

  • i (input)
  • input

image in pgm format

  • b (bitstream)
  • bitstream

file written by encoder

  • ptional

parameters :

  • bs (blocksize) - block

size in samples (default: 16)

decoder parameters:

>./ decoder

  • b (bitstream) -o (output)

required parameters :

  • b (bitstream)
  • bitstream

file to be read by decoder

  • o (output)
  • reconstructed

image in pgm format

Heiko Schwarz (Freie Universität Berlin) — Image and Video Coding