Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Video and Image Processing Suite User Guide Avalon st video.pdf
Скачиваний:
81
Добавлен:
11.06.2015
Размер:
2.64 Mб
Скачать

A-28

c_pixel

UG-VIPSUITE

2015.01.23

 

 

c_pixel

The declaration for the c_pixel class:

class c_pixel#(parameters BITS_PER_CHANNEL=8, CHANNELS_PER_PIXEL=3);

Table A-18: Method Calls for c_pixel Class

Method Call

 

Description

 

 

 

function new();

 

Constructor.

 

 

 

function void copy(c_pixel #(BITS_PER_CHANNEL,

 

Copies object pixel into this object.

CHANNELS_PER_PIXEL) pix);

 

 

 

 

 

function bit[BITS_PER_CHANNEL-1:0] get_

 

Returns pixel data for channel id.

data(int id);

 

 

 

 

 

function void set_data(int id, bit [BITS_PER_

 

Sets pixel data for channel id.

CHANNEL-1:0] data);

 

 

 

 

 

Raw Video Data Format

Altera provides and recommends two Microsoft Windows utilities for translating between .avi and .raw file formats.

You can use the following examples to translate file formats.

Altera Corporation

Avalon-ST Video Verification IP Suite

 

 

Send Feedback

UG-VIPSUITE 2015.01.23

Raw Video Data Format

A-29

• Convert .raw to .avi files.

>avi2raw.exe vip_car_0.avi vip_car_0.raw

"dshow" decoder created Information on the input file: filename: vip_car_0.avi fourcc = ARGB32

width = 160 height = 120 stride = 640 inversed = yes

endianness = little_endian frame_rate = 25

Choose output dimensions, 0 to keep original values (this will apply a crop/pad, not a scaling):

width (160) = 0 height (120) = 0

Choose output colorspace: 1.RGB

2.YCbCr

3.MONO

1

Choose output bps (8, 10) 8

Choose output interlacing: 1.progressive 2.interlaced F0 first 3.interlaced F1 first

1

Choose a number of frames to skip at the start of the sequence (use 0 to start t he decoding from the beginning) :

0

Choose the maximum number of frames to decode (use 0 to decode up to the end of the video) :

0

"raw" encoder created Decoding in progress.......

7 fields extracted deleting decoding chain deleting encoder

press a key to exit 1

• Produce a .raw file and an.spc file that contains the FOURCC information.

> more vip_car_0.spc

fourcc = RGB32 width = 160 height = 120 stride = 640 frame_rate = 25

To decode the data, the file I/O class reader must see both the .raw and .spc files. The file I/O class reader writes a .raw/.spc file pair that you can view using the .avi encoder utility.

> raw2avi.exe vip_car_1.raw vip_car_1.avi

 

"raw" decoder created

 

vip_car_1.raw:

 

RGB32 160*120, progressive, 25fps

 

"dshow" encoder created

 

AVI encoder created

 

Encoding in progress.......

 

7 frames encoded

 

deleting conversion chain

 

deleting encoder

 

press a key to exit

Altera Corporation

Avalon-ST Video Verification IP Suite

1

 

Send Feedback

 

A-30

Raw Video Data Format

UG-VIPSUITE

2015.01.23

 

 

If you don't have a no Windows machine available to run the utilities, you must then provide the video data in the correct format by some other means.

Figure A-7: Supported FOURCC Codes and Data Format

The figure below shows an example of the data format required by the file I/O class for each of the supported FOURCC codes.

YUY 2

 

 

 

 

V

 

 

 

Y

 

 

 

U

 

 

 

 

 

 

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Byte 0

 

 

Byte 1

 

 

Byte

2

 

 

 

 

Byte

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Y 410 / A 2R 10 G 10 B 10

 

 

 

 

 

 

U or B 10

 

 

 

 

 

Y or G 10

 

 

 

 

 

 

 

V or B 10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Byte 0

 

 

Byte 1

 

 

 

Byte 2

 

 

 

 

Byte 3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Y 210

 

 

 

 

 

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

U

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Byte

0

 

 

 

 

Byte

1

 

 

 

 

Byte

2

 

 

 

 

Byte

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

V

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Byte

4

 

 

 

 

Byte

5

 

 

 

 

Byte

6

 

 

 

 

Byte

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IYU 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

U 0

 

 

 

 

 

 

 

Y 0

 

 

 

 

 

 

 

V 0

 

 

 

 

 

 

 

U 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Byte

0

 

 

 

 

Byte

1

 

 

 

 

Byte

2

 

 

 

 

Byte

3

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Y 1

 

 

 

 

 

 

 

V 1

 

 

 

 

 

 

 

U 2

 

 

 

 

 

 

 

Y 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Byte

4

 

 

 

 

Byte

5

 

 

 

 

Byte

6

 

 

 

 

Byte

7

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RGB 32

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B

 

 

 

 

 

 

 

G

 

 

 

 

 

 

 

R

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Byte

0

 

 

 

 

Byte

1

 

 

 

 

Byte

2

 

 

 

 

Byte

3

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Altera Corporation

Avalon-ST Video Verification IP Suite

 

 

Send Feedback

Choosing the Correct Deinterlacer

B

2015.01.23

UG-VIPSUITE

Subscribe

Send Feedback

You should choose the right deinterlacer based on the quality of the output needed.

The simple Bob deinterlacing option produces the lowest quality outputs; and the motion adaptive high quality (HQ) option produces the highest quality outputs.

Figure B-1: Bob Deinterlacing Option

The figure below shows an example output from Bob deinterlacing option.

To enable this option, select Bob Scanline Interpolation in the Deinterlacer IP core parameter editor. With this moving Dial test sequence, a Bob deinterlacer produces the characteristic staircasing effect on the edges of these diagonal lines. The area is 454 look-up tables (LUTs).

© 2015 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.

www.altera.com

ISO 9001:2008 Registered

101 Innovation Drive, San Jose, CA 95134

B-2

Choosing the Correct Deinterlacer

UG-VIPSUITE

2015.01.23

 

 

Figure B-2: Motion Adaptive Deinterlacing Option

The figure below shows an example output from Motion Adaptive deinterlacing option.

To enable this option, select Motion Adaptive in the Deinterlacer or Deinterlacer II IP core parameter. If you are using the Deinterlacer IP core parameter editor, you need to select Triple buffering with rate conversion for the buffering mode.

With the moving Dial test sequence, a motion-adaptive interlacer detects the motion, preventing incoming artifacts that would otherwise appear. The motion-adaptive interlacer performs a Bob interpo lation and operates on a 3x3 kernel of pixels, therefore has the ability to interpolate along the diagonal and reduce the staircasing effect. The area is 5,188 LUTs for the Deinterlacer IP core and 3, 696 LUTs for the Deinterlacer II IP core.

Figure B-3: Motion Adaptive High Quality Deinterlacing Option

The figure below shows an example output from Motion Adaptive High Quality deinterlacing option.

To enable this option, select Motion Adaptive High Quality in the Deinterlacer II IP core parameter.

Altera Corporation

Choosing the Correct Deinterlacer

 

 

Send Feedback

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]