Skip to content

Sample implementation for converting YCbCr to RGB using CSC controller with the PSP (Playsation Portable) Media Engine's AVC hardware module. Processes Y and packed CbCr planes in 16-pixel vertical bands with alternating left/right pattern. Requires physical hardware with Media Engine support.

License

Notifications You must be signed in to change notification settings

mcidclan/me-avc-csc-hd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AVC CSC YCbCr HD Sample Code

This repository provides a sample implementation for converting YCbCr data to RGB using the CSC controller with the AVC hardware module hosted on the Media Engine.

Implementation Overview

Unlike VME-based approaches, the Media Engine's AVC hardware module handles color space conversion differently by processing:

  • A Y plane (luminance)
  • A packed CbCr plane (chrominance)

Data Format Requirements

The AVC hardware module requires YCbCr data to be organized in a specific band-based format:

  • 16-pixel-wide vertical bands: Data must be chunked into these narrow vertical strips
  • Alternating pattern: Within 32-pixel-wide blocks, bands alternate between left and right halves
    • First 16 pixels go to the left half
    • Next 16 pixels go to the right half
    • Pattern continues across the image width
  • Hardware-specific layout: Preprocessing required using the included Python conversion script

Input Constraints

  • Image dimensions:
    • For RGB565 output: width & height must be multiples of 32
    • For ARGB8888 output: width & height must be multiples of 64
  • Band width requirement: width must be a multiple of 16

Generate YCbCr Planes

Example for a 960×960 image (maximum supported by the hardware in this configuration):

  1. Generate NV12 data:
.\ffmpeg.exe -i csc960x960.png -vf "scale=960:960,format=nv12" -f rawvideo -pix_fmt nv12 nv12_full.bin -y
  1. Convert for hardware use:
python ./n12ToHw.py nv12_full.bin 960 960 --max_chunk_height 480

Build & Run

make clean && make

Use arrow keys to move the canvas.

Special Thanks To

  • The PSP homebrew community, for being an invaluable source of knowledge.
  • All developers and contributors who have supported and continue to support the scene.

resources:

m-c/d

About

Sample implementation for converting YCbCr to RGB using CSC controller with the PSP (Playsation Portable) Media Engine's AVC hardware module. Processes Y and packed CbCr planes in 16-pixel vertical bands with alternating left/right pattern. Requires physical hardware with Media Engine support.

Topics

Resources

License

Stars

Watchers

Forks