Hello World for JCU(JPEG Codec Unit). JCU is JPEG codec unit of RZ/A1. When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

License

When you use this program, we judge you have agreed to the following contents.

本プログラムを使用する際は、以下の内容に合意した事になります。

https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

Information

Japanese version is available in lower part of this page.

このページの後半に日本語版が用意されています.

What is this ?

JPEG driver sample program using GR-PEACH or GR-LYCHEE.
When you decode/encode file, input file set width is 320 pixel and height is 240 pixel.

FormatJPEG file".jpg"
Color formatYCbCr422
Pixel size320x240
FormatBitmap file".bin"
Color formatYCbCr422
Pixel size320x240

Composition

GR-PEACH or GR-LYCHEE, PC and USB media.

  • Use USB0 of GR-PEACH:

/media/uploads/tyama/jpeg_conv_usb0.png

If you use the USB0 as USB Host, please close GR-PEACH's JP3.

/media/uploads/tyama/gr-peach-c_usb2.png

Please select USB0 connector by the following configuration.

mbed_app.json

{
    "config": {
        "usb-host-ch":{
            "help": "(for GR-PEACH) 0:ch0 1:ch1",
            "value": "0"
        },
        "audio-camera-shield":{
            "help": "(for GR-PEACH) 0:not use 1:use",
            "value": "0"
        }
   }
}


  • Use USB1 of GR-PEACH:

/media/uploads/tyama/jpeg_conv_usb1.png

If you use the USB1 as USB Host, please close Audio/Camera Shield's JP1.

/media/uploads/tyama/audiocamerashield_jp1.jpg

Please select Audio/Camera Shield and USB1 connector by the following configuration.

mbed_app.json

{
    "config": {
        "usb-host-ch":{
            "help": "(for GR-PEACH) 0:ch0 1:ch1",
            "value": "1"
        },
        "audio-camera-shield":{
            "help": "(for GR-PEACH) 0:not use 1:use",
            "value": "1"
        }
    }
}



The size of the changed picture is made 320x240pixel fixing by a sample program. When using a file with the picture size besides that, please change the below.

JPEG_converter\main.cpp

#define SAMPLE_WIDTH        (320)
#define SAMPLE_HEIGHT       (240)

How to use

  1. Please turn on the power to GR-PEACH or GR-LYCHEE and start terminal software.
  2. Please connect a USB media and press the reset button on the board.
  3. Input request of the file name is output on terminal.
  4. When a file of extension ".jpg" is designated, a JPEG file is decoded. A decoded file will be data of 320x240pixel and YCbCr422.
  5. When a file of extension ".bin" is designated, it's encoded to a JPEG file. An encoded file will be a JPEG file of 320x240pixel and YCbCr422.

The default setting of serial communication (baud rate etc.) in mbed is shown the following link.
Please refer to the link and change the settings of your PC terminal software.
The default value of baud rate in mbed is 9600, and this application uses baud rate 9600.
https://developer.mbed.org/teams/Renesas/wiki/GR-PEACH-Getting-Started#install-the-usb-serial-communication


概要

GR-PEACH or GR-LYCHEEを使ったJPEG driverサンプルプログラムです。
デコード/エンコードする入力ファイルは、幅を320pixel、高さを240pixelに設定してください。

FormatJPEG file".jpg"
Color formatYCbCr422
Pixel size320x240
FormatBitmap file".bin"
Color formatYCbCr422
Pixel size320x240

構成

GR-PEACH or GR-LYCHEE、PC、USBメディア

  • GR-PEACHでUSB0を使用する場合:

/media/uploads/tyama/jpeg_conv_usb0.png

USBホストとしてUSB0を使用する場合は、GR-PEACHのJP3を閉じてください。

/media/uploads/tyama/gr-peach-c_usb2.png

以下の設定でUSB0コネクタを選択して下さい。

mbed_app.json

{
    "config": {
        "usb-host-ch":{
            "help": "(for GR-PEACH) 0:ch0 1:ch1",
            "value": "0"
        },
        "audio-camera-shield":{
            "help": "(for GR-PEACH) 0:not use 1:use",
            "value": "0"
        }
}


  • GR-PEACHでUSB1を使用する場合:

/media/uploads/tyama/jpeg_conv_usb1.png

USBホストとしてUSB1を使用する場合は、Audio/Camera ShieldのJP1を閉じてください。

/media/uploads/tyama/audiocamerashield_jp1.jpg

以下の設定でAudio/Camera ShieldとUSB1コネクタを選択して下さい。

mbed_app.json

{
    "config": {
        "usb-host-ch":{
            "help": "(for GR-PEACH) 0:ch0 1:ch1",
            "value": "1"
        },
        "audio-camera-shield":{
            "help": "(for GR-PEACH) 0:not use 1:use",
            "value": "1"
        }
    }
}



サンプルプログラムでは、変換する画像のサイズを320x240pixel固定としております。 それ以外の画像サイズのファイルを使用する場合は以下を変更してください。

JPEG_converter\main.cpp

#define SAMPLE_WIDTH        (320)
#define SAMPLE_HEIGHT       (240)

使い方

  1. GR-PEACH or GR-LYCHEEに電源を入れ、Terminalソフトを立ち上げます。
  2. USBメディアを接続し、ボード上にあるリセットします。
  3. Terminal上にファイル名の入力要求が出力されます。
  4. 拡張子".jpg"のファイルを指定するとJPEGファイルのデコードを実行します。デコードしたファイルは、320x240pixel、YCbCr422のデータとなります。
  5. 拡張子".bin"のファイルを指定するとJPEGファイルへのエンコードを実行します。エンコードしたファイルは、320x240pixel、YCbCr422のJPEGファイルとなります。

mbedのシリアル通信(ボーレート等)のデフォルト設定は以下のリンクに示しています。
リンクを参考に、お使いのPCターミナルソフトの設定を変更して下さい。
mbedでのボーレートのデフォルト値は9600で、このサンプルではボーレート9600を使います。
https://developer.mbed.org/teams/Renesas/wiki/GR-PEACH-Getting-Started#install-the-usb-serial-communication

Committer:
Osamu Nakamura
Date:
Tue Mar 21 19:22:30 2017 +0900
Revision:
7:492ae3d420d1
Parent:
5:6dfd2c98ddb9
Update GraphicsFramework to the latest one

Who changed what in which revision?

UserRevisionLine numberNew contents of line
1050186 5:6dfd2c98ddb9 1 http://developer.mbed.org/teams/Renesas/code/R_BSP/#fb9eda52224e