AN75779のサンプルデザインで4k画像を扱いたい

Tip / ログイン to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
TeMa_2997106
Level 6
Level 6
Distributor - TED (Japan)
10 likes received 10 solutions authored 250 replies posted

AN75779のサンプルデザインを元に、FullHDの画像を出力することができました。

これを、解像度を上げて4k画像を扱いたいのですが、変更する箇所はディスクリプタのみでよいでしょうか。

以前質問しました下記では、フレームレートの変更をご教示いただきましたが、今回は

サイズも変わるので、該当箇所をすべて変更する必要があると認識しています。

Re: AN75779のサンプルデザインのフレームレートについて

GPIFの入力クロックを100MHz以下にするため、設定は16bitとし、

3840×2160、7.5fps を扱おうとしています。(74.25MHz)

宜しくお願いします。

0 件の賞賛
1 解決策

まず、動作実績についてですが、"e-CAMView"では13MPの解像度の出力が確認されており、4K解像度にも対応致します。

Download e-CAMView Windows DirectShow Camera Application

次に、descriptorについて、水平方向のピクセルを3820で計算していたこと、失礼致しました。

Descriptorについて、水平方向を3840に変更して書き直しました。それから、7.5fpsについて値が少し違っていたので修正しています。

/* Class specific Uncompressed VS Frame descriptor for 4K (Ultra HD)*/

         0x1E,                           /* Descriptor size */

         0x24,                           /* Descriptor type*/

         0x05,                           /* Subtype: uncompressed frame I/F */

         0x01,                           /* Frame Descriptor Index */

         0x01,                           /* Still image capture method 1 supported */

         0x00,0x0F,                      /* Width in pixel: 3840 */

         0x70,0x08,                      /* Height in pixel 2160 */

         0x00,0x80,0x53,0x3B,            /* Min bit rate bits/s. 3840x2160x7.5x16 (bitrate = width x height x frame rate x 16bit/pixel) */

         0x00,0x80,0x53,0x3B,            /* Max bit rate bits/s. 3840x2160x7.5x16 */

         0x00,0x20,0xFD,0x00,            /* Maximum video or still frame size in bytes(Deprecated) 3840x2160x2 bytes */

         0x55,0x58,0x14,0x00,            /* Default Frame Interval 7.5 fps = (1/7.5)*10^7*/

         0x01,                           /* Frame interval(Frame Rate) types: Only one frame interval supported */

         0x55,0x58,0x14,0x00,            /* Minimum Frame Interval 7.5 fps = (1/7.5)*10^7*/

よろしくお願い致します。

Hirotaka Takayama

元の投稿で解決策を見る

9 返答(返信)
HirotakaT_91
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

はい、4K用のUncompressed VS Frame Descriptorをディスクリプタに書き加えることで実現可能です。

GPIF-IIのビット幅が16bitで動作周波数が74.25 MHzということなので、

GPIF-IIのデータ処理パフォーマンス理論値は (74.25*10^6)*16 = 1.18Gbps

それに対して4K出力が 3840*2160*16(bit)*7.5(fps) = 995Mbps となるため、出力可能です。

よろしくお願い致します。

Cypress

0 件の賞賛
TeMa_2997106
Level 6
Level 6
Distributor - TED (Japan)
10 likes received 10 solutions authored 250 replies posted

ご回答ありがとうございます。

変更箇所については、AN75779では下記しか定義(というか記載)が無いですが、

ここのみ変更すればよいのでしょうか。

VS_Frame_Descriptor.png

Min bit rate bits/s.

Max bit rate bits/s.

の2つは必要かと思いましたが、こちらには上記の計算式で得た995Mbpsを入れるのでしょうか。

Yesとすると、その場合具体的に計算結果は

 3840*2160*16*7.5=9,953,280,000

となりますが、これを16進数に直すと

 2 5143 0000‬

となり、8byteにおさまりません。

入れる値が違うのでしょうか。どのように考えればよいでしょうか。

以上です。

0 件の賞賛

以前の議論と同様に、AN75779のcyfxuvcdscr.cのConfiguration descriptorをご覧いただくと、どのように書くかがわかりやすいと思います。

UVCのSpecも参考になります。

UVC Specの通り、Min/Max bit rateは4byteフィールドでございます。

bit rateは 3840*2160*16(bit)*7.5(fps)=990144000 = (16進数)3B046600.

4Kを出力できるセンサ環境がないため実機では試していませんが、以下に4K with 7.5fpsのFrame ディスクリプタの例を記載しました。

/* Class specific Uncompressed VS Frame descriptor for VGA*/

         0x1E,                           /* Descriptor size */

         0x24,                           /* Descriptor type*/

         0x05,                           /* Subtype: uncompressed frame I/F */

         0x01,                           /* Frame Descriptor Index */

         0x01,                           /* Still image capture method 1 supported */

         0xEC,0x0E,                      /* Width in pixel: 3820 */

         0x70,0x08,                      /* Height in pixel 2160 */

         0x00,0x66,0x04,0x3B,            /* Min bit rate bits/s. 3820x2160x7.5x16 (bitrate = width x height x frame rate x 16bit/pixel) */

         0x00,0x66,0x04,0x3B,            /* Max bit rate bits/s. 3820x2160x7.5x16 */

         0x80,0xCE,0xFB,0x00,            /* Maximum video or still frame size in bytes(Deprecated) 3820x2160x2 bytes */

         0x54,0x58,0x14,0x00,            /* Default Frame Interval 7.5 fps*/

         0x01,                           /* Frame interval(Frame Rate) types: Only one frame interval supported */

         0x54,0x58,0x14,0x00,            /* Minimum Frame Interval 7.5 fps */

よろしくお願い致します。

Hirotaka Takayama

0 件の賞賛
TeMa_2997106
Level 6
Level 6
Distributor - TED (Japan)
10 likes received 10 solutions authored 250 replies posted

ありがとうございます。

ご提案いただいた表記例は途中で水平側のPixelが3840から3820で計算がなされているようでしたので、

3840で計算しなおしました。

0x1E,                           /* Descriptor size */

0x24,                           /* Descriptor type*/

0x05,                           /* Subtype: uncompressed frame I/F */

0x01,                           /* Frame Descriptor Index */

0x01,                           /* Still image capture method 1 supported */

0x00,0x0F,                      /* Width in pixel: 3840 */

0x70,0x08,                      /* Height in pixel 2160 */

0x00,0x80,0x53,0x3B,            /* Min bit rate bits/s. 3840x2160x7.5x16 (bitrate = width x height x frame rate x 16bit/pixel) */

0x00,0x80,0x53,0x3B,            /* Max bit rate bits/s. 3840x2160x7.5x16 */

0x00,0x20,0xFD,0x00,            /* Maximum video or still frame size in bytes(Deprecated) 3840x2160x2 bytes */

0x54,0x58,0x14,0x00,            /* Default Frame Interval 7.5 fps*/

0x01,                           /* Frame interval(Frame Rate) types: Only one frame interval supported */

0x54,0x58,0x14,0x00,            /* Minimum Frame Interval 7.5 fps */

で試行しています。

結果が分かりましたらご報告いたします。

以上です。

0 件の賞賛
TeMa_2997106
Level 6
Level 6
Distributor - TED (Japan)
10 likes received 10 solutions authored 250 replies posted

動作確認しましたが、これでは出力がでませんでした。

PCに対してUSB経由では何かしら画像が入っているようですが(プロトコルアナライザ等で確認しているわけではありませんが)、

PCのViewerに画像がまったく出ない状況です。

御社で4kカメラの動作実績があるViewer(PCのアプリケーション)があればご教示いただけませんでしょうか。WWでの実績、という例でも構いません。

※設定の違い等問題箇所を潰すため、不確定要素を排除したい、というのが意図です。

 現時点ではディスクリプタの問題だけでない可能性の方が高そうなので。

以上です。

0 件の賞賛

まず、動作実績についてですが、"e-CAMView"では13MPの解像度の出力が確認されており、4K解像度にも対応致します。

Download e-CAMView Windows DirectShow Camera Application

次に、descriptorについて、水平方向のピクセルを3820で計算していたこと、失礼致しました。

Descriptorについて、水平方向を3840に変更して書き直しました。それから、7.5fpsについて値が少し違っていたので修正しています。

/* Class specific Uncompressed VS Frame descriptor for 4K (Ultra HD)*/

         0x1E,                           /* Descriptor size */

         0x24,                           /* Descriptor type*/

         0x05,                           /* Subtype: uncompressed frame I/F */

         0x01,                           /* Frame Descriptor Index */

         0x01,                           /* Still image capture method 1 supported */

         0x00,0x0F,                      /* Width in pixel: 3840 */

         0x70,0x08,                      /* Height in pixel 2160 */

         0x00,0x80,0x53,0x3B,            /* Min bit rate bits/s. 3840x2160x7.5x16 (bitrate = width x height x frame rate x 16bit/pixel) */

         0x00,0x80,0x53,0x3B,            /* Max bit rate bits/s. 3840x2160x7.5x16 */

         0x00,0x20,0xFD,0x00,            /* Maximum video or still frame size in bytes(Deprecated) 3840x2160x2 bytes */

         0x55,0x58,0x14,0x00,            /* Default Frame Interval 7.5 fps = (1/7.5)*10^7*/

         0x01,                           /* Frame interval(Frame Rate) types: Only one frame interval supported */

         0x55,0x58,0x14,0x00,            /* Minimum Frame Interval 7.5 fps = (1/7.5)*10^7*/

よろしくお願い致します。

Hirotaka Takayama

TeMa_2997106
Level 6
Level 6
Distributor - TED (Japan)
10 likes received 10 solutions authored 250 replies posted

ありがとうございます。

計算方法で1点教えてください。

bit rateは

 3840*2160*16*7.5=995,328,000

となると思っていましたが、直近のコメントでのディスクリプタの設定は

 0x00,0x80,0x04,0x3B,

となっており、私の認識と異なります。どのように計算されましたでしょうか。

※Frame Intervalは頭が0x54か0x55かの違いはありますが、

 これは小数点以下を切り捨てるのか切り上げるのかの違いかと思いますので納得はできました。

以上です。

0 件の賞賛

すみません、こちらは私の間違いです。

ご指摘の通りでございます。

元のスレッドを修正させていただきました。

よろしくお願い致します。

Hirotaka Takayama

0 件の賞賛
TeMa_2997106
Level 6
Level 6
Distributor - TED (Japan)
10 likes received 10 solutions authored 250 replies posted

ご連絡ありがとうございます。

ディスクリプタ以外のところで問題があったようで、

Firmの変更により画は出るようになりました。

(タイムアウトの設定も変更しているので、そこが効いていると思われます)

ご対応ありがとうございました。

0 件の賞賛