MIPS SIMDテクノロジーとBaikal-T1プロセッサー

Baikal Electronicsの同僚は、Baikal-T1 [ L1 ]プロセッサを使用して、彼らの印象について書いてくれと申し出ました。 彼らにとって、これは開発者に自分のプロセッサの機能と特徴を伝える方法です。 私にとって-例えば、MIPSfpga-plus [ L2 ]プロジェクトに新しい機能を追加して、現代のプロセッサコアでシステムを知り、将来、より小さな「自転車」を発明する機会。 さて、通常のエンジニアリングの好奇心、再び...







今日は、MIPS Warrior P-class P5600 [ L3 ]コアで利用可能なMIPS SIMDアーキテクチャのベクトル拡張について説明します。これは、Baikal-T1プロセッサにも存在することを意味します。 この記事は、開発者を対象にしています。













はじめに



ほとんどの場合、特定のデバイス(デバイス/ハードウェア/ソフトウェアおよびハードウェアコンプレックスなど)の開発に伴い、デジタルおよびアナログ信号の処理の問題の解決策が関連付けられています。 入力には、センサーの測定値、入力/出力デバイスからの信号、ディスク上のファイルからの情報などが含まれます。 出力:モニター上の画像、スピーカーからの音、駆動制御信号、ダッシュボード上のインジケーターの表示など。および「入力と出力の間」-特定の数学的操作のセット。







この「ハードウェアでの数学」を実装する方法を簡単にリストすると、開発者が一緒にまたは別々に適用できる次のツールのリストが得られます。









同じリストですが、より詳細に
  • アナログ回路の形での実装

    デジタル機器の優位性にもかかわらず、世界と人間の感覚は依然としてアナログのままです。 好むと好まざるとにかかわらず、情報をデジタル形式で「排他的に」処理する場合でも、ADCに入る前にフィルタを設定する必要があります。 同様に、アナログコンポーネントには、積分器、微分器、加算器などを実装できます。 アナログエレクトロニクスの優位性の数十年にわたって、エンジニアはさまざまな問題を解決するために膨大な経験を積んでおり、優れた開発者(デジタルエレクトロニクスでさえ)はこの遺産を考慮に入れています[ D1 ]。







  • マイクロコントローラーソフトウェアの実装

    処理された信号はほとんどなく、数学は複雑ではないか、リソースを必要としませんか? この場合、ADC、低動作周波数、および省エネオプションを備えた比較的安価なマイクロコントローラーは非常に選択肢です。 必要に応じて、ボトルネックをアセンブラーで記述できます。







  • FPGA実装

    速度、並列処理、スケーリングのソリューションに高い要件がある場合、数学をVerilogまたはVHDLのモジュールとして説明し、処理に必要な周波数で動作できるFPGAを選択します。 ソリューションが非常に成功し、その幅広い複製に意味がある場合-ASIC [ L3 ]の世界へようこそ。







  • システムオンチップの形でのハードウェアとソフトウェアの実装

    システムは複雑すぎて完全にVerilogで記述することはできません。別のロジックを高級言語でプログラミングし、実際にすべてをLinuxから管理しますか? この場合、ソリューションはSoC(System-on-a-Chip、SoC)です。完成したプロセッサコア(Nios II、MIPSfpgaなど)を取得し、必要な周辺モジュールで重み付けします。トリッキーな数学を実行します。 一部の操作は、プロセッサー命令[ L4 ]として使用可能にできます。 はい、将来、これはASICでも実装できます。







  • デジタル信号プロセッサ(DSP)の使用

    実際、ここでは、プロセッサコア、独自の周辺機器、および高速デジタル信号処理専用のコマンドセットを備えた既製のチップを購入します。 その周りに、決定[ L10L5 ]を構築します。







  • 汎用プロセッサソフトウェアの実装

    各プロセッサメーカーは、特定の数学演算のパフォーマンスを最適化する独自のアーキテクチャソリューションを提供しています。 また、ソフトウェア開発者のタスクは、必要に応じて、メーカーが提供する機能を使用して計算を高速化することです。 これは、以下のMIPSプロセッサで説明するものです。







  • コンピューティングにグラフィックコントローラーを使用する

    現在のリストをより完全にするために、最も複雑でリソースを大量に消費する計算をビデオカード[ L6L7 ]に入れる可能性に言及することを忘れないでください。


完璧なツールはありません。 最適なツールは、プロジェクトチームが必要な能力を持ち、利用可能な、または最小限のコストで入手できる、許容可能な時間枠内で問題の解決を保証するツールです。 予算の決定、顧客の要件、そして時には政治的理由がそのような決定の採用に課せられます。







この記事が、MIPS SIMDテクノロジが利用可能なMIPSコアに基づいて構築されたバイカルT1プロセッサまたはその他の特定の計算のパフォーマンスを最適化する必要に直面している読者への入門書として役立つことを願っています。







計算リソース



次に進む前に、デジタル信号処理(DSP)の一般的なタスクの1つであるフィルタリングを検討してください。 例として、有限インパルス応答(FIR、FIR、有限インパルス応答)[ L8 ]のフィルターを使用します。 DSPの理論と数学的計算を掘り下げることなく、主なものに注目します-このタイプのデジタルフィルターを説明する方程式:













ここで、 x(n)は入力信号、 y(n)は出力信号、 Pはフィルター次数、 biはフィルター係数です。 同じ式を次のように書くことができます。













この場合、入力信号x(n)の性質を無視します。 それをADCから取得したデータとしますが、同じ成功を収めて、ファイルから読み取ることができます。 この場合、私たちにとっては重要ではありません。 現在の記事は「DSPについて」ではなく「計算について」であるため、フィルターマジックに飛び込むのではなく、オンラインサービスの1つを使用して係数を計算します[ L9 ]:







目的のフィルタリングパラメーター(たとえば、定義済みオプションのいずれか:バンドストップ-ノッチフィルター[ L11 ])を設定し、[フィルターの設計]ボタンをクリックします。













計算の結果は、フィルター[ L12 ]の周波数応答です。







フィルター周波数応答







係数とソースコードのセット:







SampleFilter.h
#ifndef SAMPLEFILTER_H_ #define SAMPLEFILTER_H_ /* FIR filter designed with http://t-filter.appspot.com sampling frequency: 2000 Hz * 0 Hz - 200 Hz gain = 1 desired ripple = 5 dB actual ripple = 3.1077303934211127 dB * 300 Hz - 500 Hz gain = 0 desired attenuation = -40 dB actual attenuation = -42.49314043914754 dB * 600 Hz - 1000 Hz gain = 1 desired ripple = 5 dB actual ripple = 3.1077303934211127 dB */ #define SAMPLEFILTER_TAP_NUM 25 typedef struct { double history[SAMPLEFILTER_TAP_NUM]; unsigned int last_index; } SampleFilter; void SampleFilter_init(SampleFilter* f); void SampleFilter_put(SampleFilter* f, double input); double SampleFilter_get(SampleFilter* f); #endif
      
      





SampleFilter.s
 #include "SampleFilter.h" static double filter_taps[SAMPLEFILTER_TAP_NUM] = { 0.037391727827352596, -0.03299884552335979, 0.044230583967321345, 0.0023050970833628304, -0.06768087195950104, -0.046347105409124706, -0.011717387509232432, -0.0707342284185183, -0.049766517282999544, 0.16086413543836361, 0.21561058688743148, -0.10159456907827959, 0.6638637561392535, -0.10159456907827959, 0.21561058688743148, 0.16086413543836361, -0.049766517282999544, -0.0707342284185183, -0.011717387509232432, -0.046347105409124706, -0.06768087195950104, 0.0023050970833628304, 0.044230583967321345, -0.03299884552335979, 0.037391727827352596 }; void SampleFilter_init(SampleFilter* f) { int i; for(i = 0; i < SAMPLEFILTER_TAP_NUM; ++i) f->history[i] = 0; f->last_index = 0; } void SampleFilter_put(SampleFilter* f, double input) { f->history[f->last_index++] = input; if(f->last_index == SAMPLEFILTER_TAP_NUM) f->last_index = 0; } double SampleFilter_get(SampleFilter* f) { double acc = 0; int index = f->last_index, i; for(i = 0; i < SAMPLEFILTER_TAP_NUM; ++i) { index = index != 0 ? index-1 : SAMPLEFILTER_TAP_NUM-1; acc += f->history[index] * filter_taps[i]; }; return acc; }
      
      





フィルターパラメーター、 SampleFilter_get関数を見て、上記のFIRフィルター式を思い出して、最も重要な点に注意してください。









ここで、いくつかの客観的な理由で問題の条件が明確になったと仮定します。













その結果、次の周波数応答が得られます。







フィルター周波数応答







私たちにとって重要なのは:









この例で示されているフィルターパラメーターの絶対値に注意を払って欲しくありません。 私が伝えたい主なアイデアは、ある時点で、計算のリソース消費の増加が以前に予測された制限を超える可能性があるということです。 そして、アルゴリズム、そのパラメーター、または入力データにわずかな変更を加えた後、プロセッサーコアがデータの「シャベル」に従事しているだけで、他のタスクの実行は言うまでもなく、これを行う時間がないことが突然判明する場合があります。 正常に処理されますが、作成された負荷または計算の期間がシステムの要件を満たしていません。 そして現時点では、かつてないほど最適化のタスクに直面しています。







計算速度



簡単な例で問題を見つけたら、その解決策を見てみましょう。 プロセッサの製造元は、計算の速度を上げるためにいくつかのトリックを踏んでいます:頻度を増やし、プロセッサコアの数を増やし、新しいコマンドを追加し、パイプライン構成、キャッシュサイズを試し、より高速なバスとインターフェイスを使用するように切り替えます。







また、開発者からアセンブラーで最もボトルネックを実装する権利、コンパイラーオプションを試す権利、アルゴリズムをリソース集約度の低いものに変更する権利、または同じ範囲のパラメーターでより予測可能な動作をする権利を開発者から奪いません。







プロセッサアーキテクチャのサポートなしでは使用できない処理速度を向上させる2つの方法に焦点を当てています。









算術演算の組み合わせ



フィルターに戻り、 SampleFilter_get関数のコードを詳しく見てみましょう。







 double SampleFilter_get(SampleFilter* f) { double acc = 0; int index = f->last_index, i; for(i = 0; i < SAMPLEFILTER_TAP_NUM; ++i) { index = index != 0 ? index-1 : SAMPLEFILTER_TAP_NUM-1; acc += f->history[index] * filter_taps[i]; }; return acc; }
      
      





そして特にライン上:







 acc += f->history[index] * filter_taps[i];
      
      





ここでは、2つの連続して実行される操作を確認します。係数を乗算し、このコマンドの結果をアキュムレーター変数に累積します。 DSPアルゴリズムでは、乗算と加算の同様の組み合わせが非常に一般的です。 しかし、これらの2つの操作が非常に頻繁に互いに隣接している場合、1サイクル内で実行される1つのチームにそれらを結合してみませんか? このような結合のアイデアは、長い間エンジニアの頭に浮かびました。 そのため、コマンド「累算による乗算」が出現し(複合乗算–加算、乗算–累積演算、MAC)、すべてのデジタルシグナルプロセッサに存在します。













SIMDアプローチ



反対側からソリューションにアプローチします。 そして、なぜ各サンプルx(n)を個別に処理するのではなく、いくつかのサンプルを1つのベクトル(配列)に結合せずに、ベクトル全体に、より正確に、ベクトルの各要素に同時にコマンドを適用する必要がありますか? この場合、1サイクル(メモリの処理をカウントしない)で、一度に複数のサンプルを処理できます。













また、最大許容ベクトルサイズが大きいほど、データ処理速度が高くなります。 この計算の編成の原則は、 SIMD (単一命令、複数データ、単一命令ストリーム、複数データストリーム)[ L13 ]と呼ばれます。 ベクトルプロセッサ[ L14 ]とスカラープロセッサへのベクトル拡張の作業は、このアプローチに基づいています。x86アーキテクチャの場合はSSEとAVX、MIPSアーキテクチャの場合はMIPS SIMD [ L15 ]です。







MIPS SIMD



ベクターアーキテクチャ拡張が構築される基本原則を理解したので、MIPS SIMDに直接アクセスできます。 この拡張の包括的な説明はドキュメント[ D2 ]に記載されていますが、主な点に注意してください。









整数演算
ニーモニック 命令の説明
ADDV、ADDVI 追加する
ADD_A、ADDS_A 絶対値の加算と飽和加算
ADDS_S、ADDS_U 符号付きおよび符号なしの飽和加算
HADD_S、HADD_U 符号付きおよび符号なしの水平方向の追加
ASUB_S、ASUB_U 符号付きおよび符号なし減算の絶対値
AVE_S、AVE_U 符号付きおよび符号なしの平均
AVER_S、AVER_U 四捨五入による符号付きおよび符号なしの平均
DOTP_S、DOTP_U 署名付きおよび署名なしのドット積
DPADD_S、DPADD_U 署名付きおよび署名なしのドット積追加
DPSUB_S、DPSUB_U 符号付きおよび符号なしのドット積減算
DIV_S、DIV_U 割る
マドヴ 乗算加算
MAX_A、MIN_A 絶対値の最大値と最小値
MAX_S、MAXI_S、MAX_U、MAXI_U 符号付きおよび符号なしの最大値
MIN_S、MINI_S、MIN_U、MINI_U 符号付きおよび符号なしの最大値
Msubv 乗算減算
マルチ 掛ける
MOD_S、MOD_U 符号付きおよび符号なしの剰余(モジュロ)
SAT_S、SAT_U 署名付きおよび署名なしのサチュレート
SUBS_S、SUBS_U 符号付きおよび符号なしの飽和減算
HSUB_S、HSUB_U 符号付きおよび符号なしの水平減算
SUBSUU_S 符号付き飽和符号なし減算
SUBSUS_U 符号なしからの符号なし飽和符号付き減算
SUBV、SUBVI 引く


ビット演算
ニーモニック 命令の説明
AND、ANDI 論理的
BCLR、BCLRI ビットクリア
BINSL、BINSLI、BINSR、BINSRI 左右のビット挿入
BMNZ、BMNZI ゼロでない場合のビット移動
BMZ、BMZI ゼロの場合のビット移動
BNEG、BNEGI ビット否定
BSEL、BSELI ビット選択
BSET、BSETI ビットセット
NLOCリーディング 1ビットカウント
NLZCリーディング ゼロビットカウント
NOR、NORI 論理否定または
PCNT 人口(ビットを1に設定)カウント
または、ORI 論理的または
SLL、SLLI 左にシフト
SRA、SRAI 右シフト算術
SRAR、SRARI 丸め右シフト演算
SRL、SRLI 右シフト論理
SRLR、SRLRI 丸めシフト右論理
XOR、XORI 論理排他的OR


浮動小数点算術演算
ニーモニック 命令の説明
ファッド 浮動小数点の追加
Fdiv 浮動小数点
FEXP2 浮動小数点ベース2のべき乗
FLOG2 浮動小数点ベース2対数
FMADD、FMSUB 浮動小数点融合乗算加算および乗算減算
FMAX、FMIN 浮動小数点の最大値と最小値
FMAX_A、FMIN_A 絶対値の浮動小数点の最大値と最小値
Fmul 浮動小数点乗算
Frcp 近似浮動小数点逆数
フリント 整数への浮動小数点の丸め
FRSQRT 平方根の近似浮動小数点逆数
FSQRT 浮動小数点平方根
FSUB 浮動小数点減算


非算術浮動小数点演算
ニーモニック 命令の説明
FCLASS 浮動小数点クラスマスク


浮動小数点比較演算
ニーモニック 命令の説明
FCAF 浮動小数点の静かな比較は常に偽
FCUN 浮動小数点Quiet Compare Unordered
FCOR 浮動小数点クワイエット比較順序付け
Fceq 浮動小数点の静かな比較が等しい
FCUNE 浮動小数点の静かな比較、順序なしまたは等しくない
FCUEQ 浮動小数点Quiet Compare UnorderedまたはEqual
FCNE 等しくない浮動小数点の静かな比較
FCLT 浮動小数点の静かな比較
FCULT 浮動小数点の静かな比較順不同またはより小さい
FCLE 浮動小数点の静かな比較がより小さいか等しい
FCULE 浮動小数点の静かな比較、順序なし、または以下
FSAF 浮動小数点信号比較は常に偽
FSUN 浮動小数点信号方式比較順不同
FSOR 浮動小数点シグナリング比較順序付け
FSEQ 浮動小数点信号の比較が等しい
FSUNE 浮動小数点信号の比較順序なしまたは等しくない
FSUEQ 浮動小数点シグナリングの比較順序なしまたは等しい
FSNE 浮動小数点信号の比較が等しくない
FSLT 浮動小数点シグナリングの比較
FSULT 浮動小数点信号の比較順序なしまたは未満
FSLE 浮動小数点信号の比較がより小さいか等しい
FSULE 浮動小数点シグナリングで順序付けられていないか、等しいか小さいかを比較


浮動小数点変換操作
ニーモニック 命令の説明
フェクスド 浮動小数点ダウンコンバート交換フォーマット
FEXUPL、FEXUPR 左半分および右半分の浮動小数点アップコンバート交換フォーマット
FFINT_S、FFINT_U 符号付きおよび符号なし整数からの浮動小数点変換
FFQL、FFQR 固定小数点からの左半分および右半分の浮動小数点変換
FTINT_S、FTINT_U 浮動小数点の丸めと符号付きおよび符号なし整数への変換
FTRUNC_S、FTRUNC_U 浮動小数点の切り捨ておよび符号付きおよび符号なし整数への変換
FTQ 浮動小数点の丸めと固定小数点への変換


固定小数点演算
ニーモニック 命令の説明
MADD_Q、MADDR_Q 固定小数点乗算および加算(丸めなしおよび丸めあり)
MSUB_Q、MSUBR_Q 固定小数点の乗算と減算、丸めなしおよび丸めあり
MUL_Q、MULR_Q 丸めなしおよび丸めありの固定小数点乗算


分岐操作
ニーモニック 命令の説明
Bnz ゼロでない場合分岐
Bz ゼロの場合分岐
CEQ、CEQI 等しいと比較
CLE_S、CLEI_S、CLE_U、CLEI_U 符号なしと符号なしの比較
CLT_S、CLTI_S、CLT_U、CLTI_U 未署名と未署名の比較


ベクターのロードおよびアンロード操作
ニーモニック 命令の説明
CFCMSA、CTCMSA MSA制御レジスタからのコピーおよびMSA制御レジスタへのコピー
LD 荷重ベクトル
LDI すぐにロード
移動 ベクトルからベクトルへの移動
スプラット、スプラティ ベクター要素の複製
塗りつぶし GPRからのベクトル
挿入、挿入 GPRとベクター要素0をベクター要素に挿入する
COPY_S、COPY_U エレメントをGPR署名および未署名にコピーします
ST 店舗ベクトル


ベクトル順列演算
ニーモニック 命令の説明
ILVEV、ILVOD インターリーブ偶数、奇数
ILVL、ILVR 左、右をインターリーブ
PCKEV、PCKOD 偶数および奇数要素をパック
SHF シャッフルを設定する
SLD、SLDI 要素スライド
VSHF ベクトルシャッフル


その他の操作
ニーモニック 命令の説明
LSA 左シフト加算またはロード/ストアのアドレス計算




チームの正式な説明







コンパイラレベルのサポート



MIPS SIMDはgccコンパイラーによってサポートされていますが、このサポートには独自の特徴があります。









最適化前のコード
 #define ROUND_POWER_OF_TWO(value, n) (((value) + (1 << ((n) - 1))) >> (n)) static inline unsigned char clip_pixel(int i32Val) { return ((i32Val) > 255) ? 255u : ((i32Val) < 0) ? 0u : (i32Val); } void vert_filter_8taps_16width_c(unsigned char *pSrc, // SOURCE POINTER int SrcStride, // SOURCE BUFFER PITCH unsigned char *pDst, // DEST POINTER int DstStride, // DEST BUFFER PITCH char *pFilter, // POINTER TO FILTER BANK int Height) // HEIGHT OF THE BLOCK { unsigned int Row, Col; int FiltSum; short Src0, Src1, Src2, Src3, Src4, Src5, Src6, Src7; pSrc -= (8 / 2 - 1) * SrcStride; // MOVE INPUT SRC POINTER TO APPROPRIATE POSITION // LOOP FOR NUMBER OF COLUMNS-16 for (Col = 0; Col < 16; ++Col) { Src0 = pSrc[0 * SrcStride]; Src1 = pSrc[1 * SrcStride]; Src2 = pSrc[2 * SrcStride]; Src3 = pSrc[3 * SrcStride]; Src4 = pSrc[4 * SrcStride]; Src5 = pSrc[5 * SrcStride]; Src6 = pSrc[6 * SrcStride]; // LOOP FOR NUMBER OF ROWS for (Row = 0; Row < Height; Row++) { Src7 = pSrc[(7 + Row) * SrcStride]; FiltSum = 0; // ACCUMULATED FILTER SUM += PIXEL * FILTER COEFF FiltSum += (Src0 * pi8Filter[0]); FiltSum += (Src1 * pi8Filter[1]); FiltSum += (Src2 * pi8Filter[2]); FiltSum += (Src3 * pi8Filter[3]); FiltSum += (Src4 * pi8Filter[4]); FiltSum += (Src5 * pi8Filter[5]); FiltSum += (Src6 * pi8Filter[6]); FiltSum += (Src7 * pi8Filter[7]); FiltSum = ROUND_POWER_OF_TWO(FiltSum, 7); // ROUNDING pDst[Row * DstStride] = clip_pixel(FiltSum);// CLIP RESULT IN 0-255(UNSIGNED CHAR) // PREPARING FOR NEXT CONVOLUTION- SLIDING WINDOW Src0 = Src1; Src1 = Src2; Src2 = Src3; Src3 = Src4; Src4 = Src5; Src5 = Src6; Src6 = Src7; } pSrc += 1; pDst += 1; } }
      
      





MIPS SIMDを使用した最適化後のコード
 /* MSA VECTOR TYPES */ #define WRLEN 128 // VECTOR REGISTER LENGTH 128-BIT #define NUMWRELEM (WRLEN >> 3) typedef signed char IMG_VINT8 __attribute__ ((vector_size(NUMWRELEM))); //VEC SIGNED BYTES typedef unsigned char IMG_VUINT8 __attribute__ ((vector_size(NUMWRELEM))); //VEC UNSIGNED BYTES typedef short IMG_VINT16 __attribute__ ((vector_size(NUMWRELEM))); //VEC SIGNED HALF-WORD #define LOAD_UNPACK_VEC(pSrc, SrcStride, vi16VecRight, vi16VecLeft) \ { \ IMG_VUINT8 vu8Src; \ IMG_VINT16 vi16Vec0; \ IMG_VINT8 vi8Tmp0; \ /* LOAD INPUT VECTOR */ \ vu8Src = *((IMG_VINT8 *)(pSrc)); \ /* RANGE WARPING TO MAINTAIN 16 BIT PRECISION */ \ vi16Vec0 = __builtin_msa_xori_b(vu8Src, 128); \ /* CALCULATE SIGN EXTENSION */ \ vi8Tmp0 = __builtin_msa_clti_s_b(vi16Vec0, 0); \ /* INTERLEAVE RIGHT TO 16 BIT VEC */ \ vi16VecRight = __builtin_msa_ilvr_b(vi8Tmp0, vi16Vec0); \ /* INTERLEAVE LEFT TO 16 BIT VEC */ \ vi16VecLeft = __builtin_msa_ilvl_b(vi8Tmp0, vi16Vec0); \ pSrc += SrcStride; \ } void vert_filter_8taps_16width_msa(unsigned char *pSrc, // SOURCE POINTER int SrcStride, // SOURCE BUFFER PITCH unsigned char *pDst, // DEST POINTER int DstStride, // DEST BUFFER PITH char *pFilter, // POINTER TO FILTER BANK int Height) // HEIGHT OF THE BLOCK { int u32LoopCnt; VINT16 vi16Vec0Right, vi16Vec1Right, vi16Vec2Right, vi16Vec3Right; VINT16 vi16Vec4Right, vi16Vec5Right, vi16Vec6Right, vi16Vec7Right; VINT16 vi16Vec0Left, vi16Vec1Left, vi16Vec2Left, vi16Vec3Left; VINT16 vi16Vec4Left, vi16Vec5Left, vi16Vec6Left, vi16Vec7Left; VINT16 vi16Temp1Right, vi16Temp1Left; VINT16 vi16Filt0, vi16Filt1, vi16Filt2, vi16Filt3; VINT16 vi16Filt4, vi16Filt5, vi16Filt6, vi16Filt7; pSrc -= (3 * SrcStride); // PREPARE FILTER COEFF IN VEC REGISTERS vi16Filt0 = __builtin_msa_fill_h(*(pFilter)); vi16Filt1 = __builtin_msa_fill_h(*(pFilter + 1)); vi16Filt2 = __builtin_msa_fill_h(*(pFilter + 2)); vi16Filt3 = __builtin_msa_fill_h(*(pFilter + 3)); vi16Filt4 = __builtin_msa_fill_h(*(pFilter + 4)); vi16Filt5 = __builtin_msa_fill_h(*(pFilter + 5)); vi16Filt6 = __builtin_msa_fill_h(*(pFilter + 6)); vi16Filt7 = __builtin_msa_fill_h(*(pFilter + 7)); //LOAD 7 INPUT VECTORS LOAD_UNPACK_VEC(pSrc, SrcStride, vi16Vec0Right, vi16Vec0Left) LOAD_UNPACK_VEC(pSrc, SrcStride, vi16Vec1Right, vi16Vec1Left) LOAD_UNPACK_VEC(pSrc, SrcStride, vi16Vec2Right, vi16Vec2Left) LOAD_UNPACK_VEC(pSrc, SrcStride, vi16Vec3Right, vi16Vec3Left) LOAD_UNPACK_VEC(pSrc, SrcStride, vi16Vec4Right, vi16Vec4Left) LOAD_UNPACK_VEC(pSrc, SrcStride, vi16Vec5Right, vi16Vec5Left) LOAD_UNPACK_VEC(pSrc, SrcStride, vi16Vec6Right, vi16Vec6Left) // START CONVOLUTION VERTICALLY for (u32LoopCnt = Height; u32LoopCnt--; ) { //LOAD 8TH INPUT VECTOR LOAD_UNPACK_VEC(pSrc, SrcStride, vi16Vec7Right, vi16Vec7Left) /* FILTER CALC */ IMG_VINT16 vi16Tmp1, vi16Tmp2; IMG_VINT8 vi8Tmp3; // 8 TAP VECTORIZED CONVOLUTION FOR RIGHT HALF vi16Tmp1 = (vi16Vec0Right * vi16Filt0); vi16Tmp1 += (vi16Vec1Right * vi16Filt1); vi16Tmp1 += (vi16Vec2Right * vi16Filt2); vi16Tmp1 += (vi16Vec3Right * vi16Filt3); vi16Tmp2 = (vi16Vec4Right * vi16Filt4); vi16Tmp2 += (vi16Vec5Right * vi16Filt5); vi16Tmp2 += (vi16Vec6Right * vi16Filt6); vi16Tmp2 += (vi16Vec7Right * vi16Filt7); vi16Temp1Right = __builtin_msa_adds_s_h(vi16Tmp1, vi16Tmp2); // 8 TAP VECTORIZED CONVOLUTION FOR LEFT HALF vi16Tmp1 = (vi16Vec0Left * vi16Filt0); vi16Tmp1 += (vi16Vec1Left * vi16Filt1); vi16Tmp1 += (vi16Vec2Left * vi16Filt2); vi16Tmp1 += (vi16Vec3Left * vi16Filt3); vi16Tmp2 = (vi16Vec4Left * vi16Filt4); vi16Tmp2 += (vi16Vec5Left * vi16Filt5); vi16Tmp2 += (vi16Vec6Left * vi16Filt6); vi16Tmp2 += (vi16Vec7Left * vi16Filt7); vi16Temp1Left = __builtin_msa_adds_s_h(vi16Tmp1, vi16Tmp2); // ROUNDING RIGHT SHIFT RANGE CLIPPING AND NARROWING vi16Temp1Right = __builtin_msa_srari_h(vi16Temp1Right, 7); vi16Temp1Right = __builtin_msa_sat_s_h(vi16Temp1Right, 7); vi16Temp1Left = __builtin_msa_srari_h(vi16Temp1Left, 7); vi16Temp1Left = __builtin_msa_sat_s_h(vi16Temp1Left, 7); vi8Tmp3 = __builtin_msa_pckev_b(vi16Temp1Left, vi16Temp1Right); vi8Tmp3 = __builtin_msa_xori_b(vi8Tmp3, 128); // STORE OUTPUT VEC *((IMG_VINT8 *)(pDst)) = (vi8Tmp3); pDst += DstStride; // PREPARING FOR NEXT CONVOLUTION- SLIDING WINDOW vi16Vec0Right = vi16Vec1Right; vi16Vec1Right = vi16Vec2Right; vi16Vec2Right = vi16Vec3Right; vi16Vec3Right = vi16Vec4Right; vi16Vec4Right = vi16Vec5Right; vi16Vec5Right = vi16Vec6Right; vi16Vec6Right = vi16Vec7Right; vi16Vec0Left = vi16Vec1Left; vi16Vec1Left = vi16Vec2Left; vi16Vec2Left = vi16Vec3Left; vi16Vec3Left = vi16Vec4Left; vi16Vec4Left = vi16Vec5Left; vi16Vec5Left = vi16Vec6Left; vi16Vec6Left = vi16Vec7Left; } }
      
      





性能評価



当初、MIPS SIMDを使用する場合のパフォーマンスの向上を評価するための簡単なアプリケーション(合成テスト)を作成することを考えていました。 しかし、すべての魅力にもかかわらず、このオプションはユーザーの実際のタスクから隔離されているため、指標ではありません。 幸いなことに、イマジネーションテクノロジーズとMIPSの従業員は、オーディオとビデオを変換するために広く使用されているオープンソースアプリケーション[ L19 ] ffmpeg [ L18 ]に多大な貢献をしました。 彼らは、他の誰も知らないように、問題のテクノロジーを適切に使用する方法を知っていると信じています。つまり、このコードは可能な限り効率的でなければなりません。







したがって、ffmpegをMIPS SIMDサポートありとなしの2つのバージョンでコンパイルすると、同じ入力データの作業速度を比較し、その結果に基づいてベクトルコンピューティングの有効性について結論を出すことができます。







Ffmpegビルド



Linuxを実行しているx86マシンで実行されます。 開発ツールは、クロスコンパイルモードでImagination Technologies [ L20 ]サイトから使用されます。 テストは、執筆時点の最新の安定版リリース-ffmpeg 3.3 [ L19 ]で実行されます。







MIPS SIMD対応バージョンのFfmpeg設定:







 ./configure --enable-cross-compile --prefix=../ffmpeg-msa --cross-prefix=/home/stas/mipsfpga/toolchain/mips-mti-linux-gnu/2016.05-03/bin/mips-mti-linux-gnu- --arch=mips --cpu=p5600 --target-os=linux --extra-cflags="-EL -static" --extra-ldflags="-EL -static" --disable-iconv
      
      





また、MIPS SIMDサポートを無効にした場合:







 ./configure --enable-cross-compile --prefix=../ffmpeg-soft --cross-prefix=/home/stas/mipsfpga/toolchain/mips-mti-linux-gnu/2016.05-03/bin/mips-mti-linux-gnu- --arch=mips --cpu=p5600 --target-os=linux --extra-cflags="-EL -static" --extra-ldflags="-EL -static" --disable-iconv --disable-msa
      
      





構成設定の説明
パラメータ 説明
--enable-cross-compile アセンブリは、優れたターゲットアーキテクチャを備えたマシンで実行されます。
--prefix = .. / ffmpeg-msa make installコマンドの後にファイルが配置されるディレクトリ
--cross-prefix = .. / mips-mti-linux-gnu- ツールチェーンへのパス
--arch = mips ターゲットアーキテクチャ-MIPS
--cpu = p5600 ターゲットプロセッサコア-p5600
--target-os = linux ターゲットOS-Linux
--extra-cflags = "-EL -static" ターゲットシステムはリトルエンディアンです。静的バインディングを使用します
--extra-ldflags = "-EL -static" 同様に
--disable-iconv テキストエンコーディングに関連する機能を無効にします
--disable-msa MIPS SIMDを使用しないでください


これらの手順を繰り返す場合、libavcodec \ mips \ hevcpred_msa.cファイルに追加する必要がある修正を行うために、MIPS SIMDサポート付きのffmpeg 3.3ビルドがマイナーエラーで失敗することに注意してください。







 #include "libavcodec/hevcdec.h"
      
      





テスト中



バイカルT1プロセッサで実行されます。







 # uname -a Linux baikal-BFK-18446744073709551615 4.4.41-bfk #0 SMP Tue Apr 25 15:54:24 MSK 2017 mips GNU/Linux
      
      





x264 [ L21 ]およびx265 [ L22 ]を使用してエンコードされた2つのビデオが入力として機能します。 テストタスクは、スクリーンショット付きのビデオを定期的にデコードすることです。







 ./ffmpeg-mips/ffmpeg-msa/bin/ffmpeg -i ./The\ Simpsons\ Movie\ -\ Trailer_x264.mp4 -vf fps=1/10 ./out_img/ffmpeg-msa_x264_%d.jpg -report -benchmark ./ffmpeg-mips/ffmpeg-msa/bin/ffmpeg -i ./Tears_400_x265.mp4 -vf fps=1 ./out_img/ffmpeg-msa_x265_%d.jpg -report -benchmark ./ffmpeg-mips/ffmpeg-soft/bin/ffmpeg -i ./The\ Simpsons\ Movie\ -\ Trailer_x264.mp4 -vf fps=1/10 ./out_img/ffmpeg-soft_x264_%d.jpg -report -benchmark ./ffmpeg-mips/ffmpeg-soft/bin/ffmpeg -i ./Tears_400_x265.mp4 -vf fps=1 ./out_img/ffmpeg-soft_x265_%d.jpg -report -benchmark
      
      





起動オプションの説明
パラメータ 説明
-i ./Tears_400_x265.mp4 処理するファイル
-vf fps = 1 スクリーンショットを撮る期間(頻度)(短いクリップの場合は1秒、長いクリップの場合は10秒)
./out_img/ffmpeg-soft x264 %d.jpg 出力ファイル名テンプレート
-レポート 作業結果に関するレポートを生成する
-ベンチマーク パフォーマンスデータを含める


Ffmpegの結果



スクリプト 継続時間(秒)
x264 MIPS SIMD 113
x265 MIPS SIMD 22
x264 MIPS SIMD 164
x265 MIPS SIMD 52


, MIPS SIMD 1.5 — 2.4 .







ffmpeg github [ L23 ].







x264 MIPS SIMD (, )
 ffmpeg started on 2010-10-18 at 00:30:26 Report written to "ffmpeg-20101018-003026.log" Command line: ./ffmpeg-mips/ffmpeg-msa/bin/ffmpeg -i "./The Simpsons Movie - Trailer_x264.mp4" -vf "fps=1/10" "./out_img/ffmpeg-msa_x264_%d.jpg" -report -benchmark ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.9.2 (Codescape GNU Tools 2016.05-03 for MIPS MTI Linux) configuration: --enable-cross-compile --prefix=../ffmpeg-msa --cross-prefix=/home/stas/mipsfpga/toolchain/mips-mti-linux-gnu/2016.05-03/bin/mips-mti-linux-gnu- --arch=mips --cpu=p5600 --target-os=linux --extra-cflags='-EL -static' --extra-ldflags='-EL -static' --disable-iconv libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 Splitting the commandline. Reading option '-i' ... matched as input url with argument './The Simpsons Movie - Trailer_x264.mp4'. Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'fps=1/10'. Reading option './out_img/ffmpeg-msa_x264_%d.jpg' ... matched as output url. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-benchmark' ... matched as option 'benchmark' (add timings for benchmarking) with argument '1'. Finished splitting the commandline. Parsing a group of options: global . Applying option report (generate a report) with argument 1. Applying option benchmark (add timings for benchmarking) with argument 1. Successfully parsed a group of options. Parsing a group of options: input url ./The Simpsons Movie - Trailer_x264.mp4. Successfully parsed a group of options. Opening an input file: ./The Simpsons Movie - Trailer_x264.mp4. [file @ 0x1fce0e0] Setting default whitelist 'file,crypto' [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] ISO: File Type Major Brand: isom [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] Unknown dref type 0x206c7275 size 12 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] Unknown dref type 0x206c7275 size 12 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] Before avformat_find_stream_info() pos: 73516232 bytes read:65587 seeks:1 nb_streams:2 [h264 @ 0x1fcecb0] nal_unit_type: 7, nal_ref_idc: 3 [h264 @ 0x1fcecb0] nal_unit_type: 8, nal_ref_idc: 3 [h264 @ 0x1fcecb0] nal_unit_type: 6, nal_ref_idc: 0 [h264 @ 0x1fcecb0] nal_unit_type: 5, nal_ref_idc: 3 [h264 @ 0x1fcecb0] user data:"x264 - core 54 svn-620M - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x1:0x131 me=umh subme=6 brdo=1 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 chroma_qp_offset=0 threads=1 nr=0 decimate=1 mbaff=0 bframes=1 b_pyramid=0 b_adapt=1 b_bias=0 direct=3 wpredb=0 bime=0 keyint=250 keyint_min=25 scenecut=40 rc=2pass bitrate=4214 ratetol=1.0 rceq='blurCplx^(1-qComp)' qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 pb_ratio=1.30" [h264 @ 0x1fcecb0] Reinit context to 1280x544, pix_fmt: yuv420p [h264 @ 0x1fcecb0] no picture [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] All info found [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] After avformat_find_stream_info() pos: 94845 bytes read:141348 seeks:2 frames:13 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './The Simpsons Movie - Trailer_x264.mp4': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 creation_time : 2007-02-19T05:03:04.000000Z Duration: 00:02:17.30, start: 0.000000, bitrate: 4283 kb/s Stream #0:0(und), 12, 1/24000: Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x544, 4221 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default) Metadata: creation_time : 2007-02-19T05:03:04.000000Z handler_name : GPAC ISO Video Handler Stream #0:1(und), 1, 1/48000: Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 64 kb/s (default) Metadata: creation_time : 2007-02-19T05:03:08.000000Z handler_name : GPAC ISO Audio Handler Successfully opened the file. Parsing a group of options: output url ./out_img/ffmpeg-msa_x264_%d.jpg. Applying option vf (set video filters) with argument fps=1/10. Successfully parsed a group of options. Opening an output file: ./out_img/ffmpeg-msa_x264_%d.jpg. Successfully opened the file. detected 2 logical cores [h264 @ 0x20191e0] nal_unit_type: 7, nal_ref_idc: 3 [h264 @ 0x20191e0] nal_unit_type: 8, nal_ref_idc: 3 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native)) Press [q] to stop, [?] for help cur_dts is invalid (this is harmless if it occurs once at the start per stream) cur_dts is invalid (this is harmless if it occurs once at the start per stream) [h264 @ 0x20191e0] nal_unit_type: 6, nal_ref_idc: 0 [h264 @ 0x20191e0] nal_unit_type: 5, nal_ref_idc: 3 [h264 @ 0x20191e0] user data:"x264 - core 54 svn-620M - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x1:0x131 me=umh subme=6 brdo=1 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 chroma_qp_offset=0 threads=1 nr=0 decimate=1 mbaff=0 bframes=1 b_pyramid=0 b_adapt=1 b_bias=0 direct=3 wpredb=0 bime=0 keyint=250 keyint_min=25 scenecut=40 rc=2pass bitrate=4214 ratetol=1.0 rceq='blurCplx^(1-qComp)' qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 pb_ratio=1.30" [h264 @ 0x20191e0] Reinit context to 1280x544, pix_fmt: yuv420p [h264 @ 0x20191e0] no picture cur_dts is invalid (this is harmless if it occurs once at the start per stream) [h264 @ 0x2026050] nal_unit_type: 1, nal_ref_idc: 2 [h264 @ 0x2060f00] nal_unit_type: 1, nal_ref_idc: 0 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [h264 @ 0x20191e0] nal_unit_type: 1, nal_ref_idc: 2 [Parsed_fps_0 @ 0x202bf50] Setting 'fps' to value '1/10' [Parsed_fps_0 @ 0x202bf50] fps=1/10 [graph 0 input from stream 0:0 @ 0x202c6f0] Setting 'video_size' to value '1280x544' [graph 0 input from stream 0:0 @ 0x202c6f0] Setting 'pix_fmt' to value '0' [graph 0 input from stream 0:0 @ 0x202c6f0] Setting 'time_base' to value '1/24000' [graph 0 input from stream 0:0 @ 0x202c6f0] Setting 'pixel_aspect' to value '0/1' [graph 0 input from stream 0:0 @ 0x202c6f0] Setting 'sws_param' to value 'flags=2' [graph 0 input from stream 0:0 @ 0x202c6f0] Setting 'frame_rate' to value '24000/1001' [graph 0 input from stream 0:0 @ 0x202c6f0] w:1280 h:544 pixfmt:yuv420p tb:1/24000 fr:24000/1001 sar:0/1 sws_param:flags=2 [format @ 0x202c030] compat: called with args=[yuvj420p|yuvj422p|yuvj444p] [format @ 0x202c030] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p' [auto_scaler_0 @ 0x202c660] Setting 'flags' to value 'bicubic' [auto_scaler_0 @ 0x202c660] w:iw h:ih flags:'bicubic' interl:0 [format @ 0x202c030] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_fps_0' and the filter 'format' [AVFilterGraph @ 0x202bb80] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed [auto_scaler_0 @ 0x202c660] picking yuvj420p out of 3 ref:yuv420p alpha:0 [swscaler @ 0x202cf00] deprecated pixel format used, make sure you did set range correctly [auto_scaler_0 @ 0x202c660] w:1280 h:544 fmt:yuv420p sar:0/1 -> w:1280 h:544 fmt:yuvj420p sar:0/1 flags:0x4 [mjpeg @ 0x1ff5f90] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multiple cpu cores [mjpeg @ 0x1ff5f90] intra_quant_bias = 96 inter_quant_bias = 0 Output #0, image2, to './out_img/ffmpeg-msa_x264_%d.jpg': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 encoder : Lavf57.71.100 Stream #0:0(und), 0, 10/1: Video: mjpeg, yuvj420p(pc), 1280x544, q=2-31, 200 kb/s, 0.10 fps, 0.10 tbn, 0.10 tbc (default) Metadata: creation_time : 2007-02-19T05:03:04.000000Z handler_name : GPAC ISO Video Handler encoder : Lavc57.89.100 mjpeg Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [Parsed_fps_0 @ 0x202bf50] Dropping 1 frame(s). cur_dts is invalid (this is harmless if it occurs once at the start per stream) ... [h264 @ 0x2060f00] nal_unit_type: 1, nal_ref_idc: 2 [Parsed_fps_0 @ 0x202bf50] Dropping 1 frame(s). [Parsed_fps_0 @ 0x202bf50] Dropping 1 frame(s). [Parsed_fps_0 @ 0x202bf50] Dropping 1 frame(s). [file @ 0x209dc40] Setting default whitelist 'file,crypto' [AVIOContext @ 0x2189ab0] Statistics: 0 seeks, 1 writeouts frame= 15 fps=0.2 q=1.6 size=N/A time=00:02:30.00 bitrate=N/A speed=2.03x No more output streams to write to, finishing. frame= 15 fps=0.2 q=1.6 Lsize=N/A time=00:02:30.00 bitrate=N/A speed=2.03x video:1382kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Input file #0 (./The Simpsons Movie - Trailer_x264.mp4): Input stream #0:0 (video): 3288 packets read (72364468 bytes); 3288 frames decoded; Input stream #0:1 (audio): 1 packets read (134 bytes); Total: 3289 packets (72364602 bytes) demuxed Output file #0 (./out_img/ffmpeg-msa_x264_%d.jpg): Output stream #0:0 (video): 15 frames encoded; 15 packets muxed (1414925 bytes); Total: 15 packets (1414925 bytes) muxed bench: utime=113.070s 3288 frames successfully decoded, 0 decoding errors bench: maxrss=39264kB [Parsed_fps_0 @ 0x202bf50] 3288 frames in, 15 frames out; 3273 frames dropped, 0 frames duplicated. [AVIOContext @ 0x1fd6230] Statistics: 73517562 bytes read, 5 seeks
      
      





x265 MIPS SIMD (, )
 ffmpeg started on 2010-10-18 at 00:27:58 Report written to "ffmpeg-20101018-002758.log" Command line: ./ffmpeg-mips/ffmpeg-msa/bin/ffmpeg -i ./Tears_400_x265.mp4 -vf "fps=1" "./out_img/ffmpeg-msa_x265_%d.jpg" -report -benchmark ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.9.2 (Codescape GNU Tools 2016.05-03 for MIPS MTI Linux) configuration: --enable-cross-compile --prefix=../ffmpeg-msa --cross-prefix=/home/stas/mipsfpga/toolchain/mips-mti-linux-gnu/2016.05-03/bin/mips-mti-linux-gnu- --arch=mips --cpu=p5600 --target-os=linux --extra-cflags='-EL -static' --extra-ldflags='-EL -static' --disable-iconv libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 Splitting the commandline. Reading option '-i' ... matched as input url with argument './Tears_400_x265.mp4'. Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'fps=1'. Reading option './out_img/ffmpeg-msa_x265_%d.jpg' ... matched as output url. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-benchmark' ... matched as option 'benchmark' (add timings for benchmarking) with argument '1'. Finished splitting the commandline. Parsing a group of options: global . Applying option report (generate a report) with argument 1. Applying option benchmark (add timings for benchmarking) with argument 1. Successfully parsed a group of options. Parsing a group of options: input url ./Tears_400_x265.mp4. Successfully parsed a group of options. Opening an input file: ./Tears_400_x265.mp4. [file @ 0x1fce0e0] Setting default whitelist 'file,crypto' [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] ISO: File Type Major Brand: iso4 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] Unknown dref type 0x206c7275 size 12 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] Before avformat_find_stream_info() pos: 705972 bytes read:32827 seeks:1 nb_streams:1 [hevc @ 0x1fceca0] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1fceca0] Decoding VPS [hevc @ 0x1fceca0] Main profile bitstream [hevc @ 0x1fceca0] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1fceca0] Decoding SPS [hevc @ 0x1fceca0] Main profile bitstream [hevc @ 0x1fceca0] Decoding VUI [hevc @ 0x1fceca0] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1fceca0] Decoding PPS [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] All info found [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1fcd980] After avformat_find_stream_info() pos: 20299 bytes read:65595 seeks:2 frames:1 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './Tears_400_x265.mp4': Metadata: major_brand : iso4 minor_version : 1 compatible_brands: iso4hvc1 creation_time : 2014-08-25T18:10:46.000000Z Duration: 00:00:13.96, start: 0.125000, bitrate: 404 kb/s Stream #0:0(und), 1, 1/24000: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 1920x800, 402 kb/s, 24 fps, 24 tbr, 24k tbn, 24 tbc (default) Metadata: creation_time : 2014-08-25T18:10:46.000000Z handler_name : hevc:fps=24@GPAC0.5.1-DEV-rev4807 Successfully opened the file. Parsing a group of options: output url ./out_img/ffmpeg-msa_x265_%d.jpg. Applying option vf (set video filters) with argument fps=1. Successfully parsed a group of options. Opening an output file: ./out_img/ffmpeg-msa_x265_%d.jpg. Successfully opened the file. detected 2 logical cores [hevc @ 0x1fe5a00] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1fe5a00] Decoding VPS [hevc @ 0x1fe5a00] Main profile bitstream [hevc @ 0x1fe5a00] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1fe5a00] Decoding SPS [hevc @ 0x1fe5a00] Main profile bitstream [hevc @ 0x1fe5a00] Decoding VUI [hevc @ 0x1fe5a00] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1fe5a00] Decoding PPS Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> mjpeg (native)) Press [q] to stop, [?] for help cur_dts is invalid (this is harmless if it occurs once at the start per stream) cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0x1fe5a00] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1fe5a00] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1fe5a00] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1fe5a00] Decoding SEI [hevc @ 0x1fe5a00] Skipped PREFIX SEI 5 [hevc @ 0x1fe5a00] Decoding SEI [hevc @ 0x1fe5a00] Skipped PREFIX SEI 6 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0x1ffeba0] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x200c4d0] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x200c4d0] Output frame with POC 0. [hevc @ 0x1fe5a00] Decoded frame with POC 0. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0x1fe5a00] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1fe5a00] Output frame with POC 1. [hevc @ 0x1ffeba0] Decoded frame with POC 5. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0x1ffeba0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1ffeba0] Output frame with POC 2. [hevc @ 0x200c4d0] Decoded frame with POC 3. [Parsed_fps_0 @ 0x201a6c0] Setting 'fps' to value '1' [Parsed_fps_0 @ 0x201a6c0] fps=1/1 [graph 0 input from stream 0:0 @ 0x201abb0] Setting 'video_size' to value '1920x800' [graph 0 input from stream 0:0 @ 0x201abb0] Setting 'pix_fmt' to value '0' [graph 0 input from stream 0:0 @ 0x201abb0] Setting 'time_base' to value '1/24000' [graph 0 input from stream 0:0 @ 0x201abb0] Setting 'pixel_aspect' to value '0/1' [graph 0 input from stream 0:0 @ 0x201abb0] Setting 'sws_param' to value 'flags=2' [graph 0 input from stream 0:0 @ 0x201abb0] Setting 'frame_rate' to value '24/1' [graph 0 input from stream 0:0 @ 0x201abb0] w:1920 h:800 pixfmt:yuv420p tb:1/24000 fr:24/1 sar:0/1 sws_param:flags=2 [format @ 0x201aad0] compat: called with args=[yuvj420p|yuvj422p|yuvj444p] [format @ 0x201aad0] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p' [auto_scaler_0 @ 0x201a350] Setting 'flags' to value 'bicubic' [auto_scaler_0 @ 0x201a350] w:iw h:ih flags:'bicubic' interl:0 [format @ 0x201aad0] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_fps_0' and the filter 'format' [AVFilterGraph @ 0x201a2f0] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed [auto_scaler_0 @ 0x201a350] picking yuvj420p out of 3 ref:yuv420p alpha:0 [swscaler @ 0x21d7da0] deprecated pixel format used, make sure you did set range correctly [auto_scaler_0 @ 0x201a350] w:1920 h:800 fmt:yuv420p sar:0/1 -> w:1920 h:800 fmt:yuvj420p sar:0/1 flags:0x4 [mjpeg @ 0x1fe2ba0] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multiple cpu cores [mjpeg @ 0x1fe2ba0] intra_quant_bias = 96 inter_quant_bias = 0 Output #0, image2, to './out_img/ffmpeg-msa_x265_%d.jpg': Metadata: major_brand : iso4 minor_version : 1 compatible_brands: iso4hvc1 encoder : Lavf57.71.100 Stream #0:0(und), 0, 1/1: Video: mjpeg, yuvj420p(pc), 1920x800, q=2-31, 200 kb/s, 1 fps, 1 tbn, 1 tbc (default) Metadata: creation_time : 2014-08-25T18:10:46.000000Z handler_name : hevc:fps=24@GPAC0.5.1-DEV-rev4807 encoder : Lavc57.89.100 mjpeg Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 cur_dts is invalid (this is harmless if it occurs once at the start per stream) ... No more output streams to write to, finishing. frame= 15 fps=0.7 q=24.8 Lsize=N/A time=00:00:15.00 bitrate=N/A speed=0.668x video:1084kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Input file #0 (./Tears_400_x265.mp4): Input stream #0:0 (video): 335 packets read (701773 bytes); 335 frames decoded; Total: 335 packets (701773 bytes) demuxed Output file #0 (./out_img/ffmpeg-msa_x265_%d.jpg): Output stream #0:0 (video): 15 frames encoded; 15 packets muxed (1109604 bytes); Total: 15 packets (1109604 bytes) muxed bench: utime=22.300s 335 frames successfully decoded, 0 decoding errors bench: maxrss=72432kB [Parsed_fps_0 @ 0x201a6c0] 335 frames in, 15 frames out; 320 frames dropped, 0 frames duplicated. [AVIOContext @ 0x1fd6220] Statistics: 734659 bytes read, 2 seeks
      
      





x264 MIPS SIMD (, )
 ffmpeg started on 2010-10-18 at 00:28:31 Report written to "ffmpeg-20101018-002831.log" Command line: ./ffmpeg-mips/ffmpeg-soft/bin/ffmpeg -i "./The Simpsons Movie - Trailer_x264.mp4" -vf "fps=1/10" "./out_img/ffmpeg-soft_x264_%d.jpg" -report -benchmark ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.9.2 (Codescape GNU Tools 2016.05-03 for MIPS MTI Linux) configuration: --enable-cross-compile --prefix=../ffmpeg-soft --cross-prefix=/home/stas/mipsfpga/toolchain/mips-mti-linux-gnu/2016.05-03/bin/mips-mti-linux-gnu- --arch=mips --cpu=p5600 --target-os=linux --extra-cflags='-EL -static' --extra-ldflags='-EL -static' --disable-iconv --disable-msa libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 Splitting the commandline. Reading option '-i' ... matched as input url with argument './The Simpsons Movie - Trailer_x264.mp4'. Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'fps=1/10'. Reading option './out_img/ffmpeg-soft_x264_%d.jpg' ... matched as output url. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-benchmark' ... matched as option 'benchmark' (add timings for benchmarking) with argument '1'. Finished splitting the commandline. Parsing a group of options: global . Applying option report (generate a report) with argument 1. Applying option benchmark (add timings for benchmarking) with argument 1. Successfully parsed a group of options. Parsing a group of options: input url ./The Simpsons Movie - Trailer_x264.mp4. Successfully parsed a group of options. Opening an input file: ./The Simpsons Movie - Trailer_x264.mp4. [file @ 0x1f4a0e0] Setting default whitelist 'file,crypto' [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] ISO: File Type Major Brand: isom [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] Unknown dref type 0x206c7275 size 12 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] Unknown dref type 0x206c7275 size 12 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] Before avformat_find_stream_info() pos: 73516232 bytes read:65587 seeks:1 nb_streams:2 [h264 @ 0x1f4acb0] nal_unit_type: 7, nal_ref_idc: 3 [h264 @ 0x1f4acb0] nal_unit_type: 8, nal_ref_idc: 3 [h264 @ 0x1f4acb0] nal_unit_type: 6, nal_ref_idc: 0 [h264 @ 0x1f4acb0] nal_unit_type: 5, nal_ref_idc: 3 [h264 @ 0x1f4acb0] user data:"x264 - core 54 svn-620M - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x1:0x131 me=umh subme=6 brdo=1 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 chroma_qp_offset=0 threads=1 nr=0 decimate=1 mbaff=0 bframes=1 b_pyramid=0 b_adapt=1 b_bias=0 direct=3 wpredb=0 bime=0 keyint=250 keyint_min=25 scenecut=40 rc=2pass bitrate=4214 ratetol=1.0 rceq='blurCplx^(1-qComp)' qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 pb_ratio=1.30" [h264 @ 0x1f4acb0] Reinit context to 1280x544, pix_fmt: yuv420p [h264 @ 0x1f4acb0] no picture [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] All info found [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] After avformat_find_stream_info() pos: 94845 bytes read:141348 seeks:2 frames:13 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './The Simpsons Movie - Trailer_x264.mp4': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 creation_time : 2007-02-19T05:03:04.000000Z Duration: 00:02:17.30, start: 0.000000, bitrate: 4283 kb/s Stream #0:0(und), 12, 1/24000: Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x544, 4221 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default) Metadata: creation_time : 2007-02-19T05:03:04.000000Z handler_name : GPAC ISO Video Handler Stream #0:1(und), 1, 1/48000: Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 64 kb/s (default) Metadata: creation_time : 2007-02-19T05:03:08.000000Z handler_name : GPAC ISO Audio Handler Successfully opened the file. Parsing a group of options: output url ./out_img/ffmpeg-soft_x264_%d.jpg. Applying option vf (set video filters) with argument fps=1/10. Successfully parsed a group of options. Opening an output file: ./out_img/ffmpeg-soft_x264_%d.jpg. Successfully opened the file. detected 2 logical cores [h264 @ 0x1f951e0] nal_unit_type: 7, nal_ref_idc: 3 [h264 @ 0x1f951e0] nal_unit_type: 8, nal_ref_idc: 3 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native)) Press [q] to stop, [?] for help cur_dts is invalid (this is harmless if it occurs once at the start per stream) cur_dts is invalid (this is harmless if it occurs once at the start per stream) [h264 @ 0x1f951e0] nal_unit_type: 6, nal_ref_idc: 0 [h264 @ 0x1f951e0] nal_unit_type: 5, nal_ref_idc: 3 [h264 @ 0x1f951e0] user data:"x264 - core 54 svn-620M - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x1:0x131 me=umh subme=6 brdo=1 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 chroma_qp_offset=0 threads=1 nr=0 decimate=1 mbaff=0 bframes=1 b_pyramid=0 b_adapt=1 b_bias=0 direct=3 wpredb=0 bime=0 keyint=250 keyint_min=25 scenecut=40 rc=2pass bitrate=4214 ratetol=1.0 rceq='blurCplx^(1-qComp)' qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 pb_ratio=1.30" [h264 @ 0x1f951e0] Reinit context to 1280x544, pix_fmt: yuv420p [h264 @ 0x1f951e0] no picture cur_dts is invalid (this is harmless if it occurs once at the start per stream) [h264 @ 0x1fa2050] nal_unit_type: 1, nal_ref_idc: 2 [h264 @ 0x1fdcf00] nal_unit_type: 1, nal_ref_idc: 0 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [h264 @ 0x1f951e0] nal_unit_type: 1, nal_ref_idc: 2 [Parsed_fps_0 @ 0x1fa7f50] Setting 'fps' to value '1/10' [Parsed_fps_0 @ 0x1fa7f50] fps=1/10 [graph 0 input from stream 0:0 @ 0x1fa86f0] Setting 'video_size' to value '1280x544' [graph 0 input from stream 0:0 @ 0x1fa86f0] Setting 'pix_fmt' to value '0' [graph 0 input from stream 0:0 @ 0x1fa86f0] Setting 'time_base' to value '1/24000' [graph 0 input from stream 0:0 @ 0x1fa86f0] Setting 'pixel_aspect' to value '0/1' [graph 0 input from stream 0:0 @ 0x1fa86f0] Setting 'sws_param' to value 'flags=2' [graph 0 input from stream 0:0 @ 0x1fa86f0] Setting 'frame_rate' to value '24000/1001' [graph 0 input from stream 0:0 @ 0x1fa86f0] w:1280 h:544 pixfmt:yuv420p tb:1/24000 fr:24000/1001 sar:0/1 sws_param:flags=2 [format @ 0x1fa8030] compat: called with args=[yuvj420p|yuvj422p|yuvj444p] [format @ 0x1fa8030] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p' [auto_scaler_0 @ 0x1fa8660] Setting 'flags' to value 'bicubic' [auto_scaler_0 @ 0x1fa8660] w:iw h:ih flags:'bicubic' interl:0 [format @ 0x1fa8030] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_fps_0' and the filter 'format' [AVFilterGraph @ 0x1fa7b80] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed [auto_scaler_0 @ 0x1fa8660] picking yuvj420p out of 3 ref:yuv420p alpha:0 [swscaler @ 0x1fa8f00] deprecated pixel format used, make sure you did set range correctly [auto_scaler_0 @ 0x1fa8660] w:1280 h:544 fmt:yuv420p sar:0/1 -> w:1280 h:544 fmt:yuvj420p sar:0/1 flags:0x4 [mjpeg @ 0x1f71f90] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multiple cpu cores [mjpeg @ 0x1f71f90] intra_quant_bias = 96 inter_quant_bias = 0 Output #0, image2, to './out_img/ffmpeg-soft_x264_%d.jpg': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 encoder : Lavf57.71.100 Stream #0:0(und), 0, 10/1: Video: mjpeg, yuvj420p(pc), 1280x544, q=2-31, 200 kb/s, 0.10 fps, 0.10 tbn, 0.10 tbc (default) Metadata: creation_time : 2007-02-19T05:03:04.000000Z handler_name : GPAC ISO Video Handler encoder : Lavc57.89.100 mjpeg Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [Parsed_fps_0 @ 0x1fa7f50] Dropping 1 frame(s). [h264 @ 0x1fa2050] nal_unit_type: 1, nal_ref_idc: 0 ... [AVIOContext @ 0x2229af0] Statistics: 0 seeks, 1 writeouts No more output streams to write to, finishing. frame= 15 fps=0.1 q=1.6 Lsize=N/A time=00:02:30.00 bitrate=N/A speed=1.45x video:1382kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Input file #0 (./The Simpsons Movie - Trailer_x264.mp4): Input stream #0:0 (video): 3288 packets read (72364468 bytes); 3288 frames decoded; Input stream #0:1 (audio): 1 packets read (134 bytes); Total: 3289 packets (72364602 bytes) demuxed Output file #0 (./out_img/ffmpeg-soft_x264_%d.jpg): Output stream #0:0 (video): 15 frames encoded; 15 packets muxed (1414925 bytes); Total: 15 packets (1414925 bytes) muxed bench: utime=164.240s 3288 frames successfully decoded, 0 decoding errors bench: maxrss=39936kB [Parsed_fps_0 @ 0x1fa7f50] 3288 frames in, 15 frames out; 3273 frames dropped, 0 frames duplicated. [AVIOContext @ 0x1f52230] Statistics: 73517562 bytes read, 5 seeks
      
      





x265 MIPS SIMD (, )
 ffmpeg started on 2010-10-18 at 00:27:14 Report written to "ffmpeg-20101018-002714.log" Command line: ./ffmpeg-mips/ffmpeg-soft/bin/ffmpeg -i ./Tears_400_x265.mp4 -vf "fps=1" "./out_img/ffmpeg-soft_x265_%d.jpg" -report -benchmark ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.9.2 (Codescape GNU Tools 2016.05-03 for MIPS MTI Linux) configuration: --enable-cross-compile --prefix=../ffmpeg-soft --cross-prefix=/home/stas/mipsfpga/toolchain/mips-mti-linux-gnu/2016.05-03/bin/mips-mti-linux-gnu- --arch=mips --cpu=p5600 --target-os=linux --extra-cflags='-EL -static' --extra-ldflags='-EL -static' --disable-iconv --disable-msa libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 Splitting the commandline. Reading option '-i' ... matched as input url with argument './Tears_400_x265.mp4'. Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'fps=1'. Reading option './out_img/ffmpeg-soft_x265_%d.jpg' ... matched as output url. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-benchmark' ... matched as option 'benchmark' (add timings for benchmarking) with argument '1'. Finished splitting the commandline. Parsing a group of options: global . Applying option report (generate a report) with argument 1. Applying option benchmark (add timings for benchmarking) with argument 1. Successfully parsed a group of options. Parsing a group of options: input url ./Tears_400_x265.mp4. Successfully parsed a group of options. Opening an input file: ./Tears_400_x265.mp4. [file @ 0x1f4a0e0] Setting default whitelist 'file,crypto' [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] ISO: File Type Major Brand: iso4 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] Unknown dref type 0x206c7275 size 12 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] Before avformat_find_stream_info() pos: 705972 bytes read:32827 seeks:1 nb_streams:1 [hevc @ 0x1f4aca0] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f4aca0] Decoding VPS [hevc @ 0x1f4aca0] Main profile bitstream [hevc @ 0x1f4aca0] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f4aca0] Decoding SPS [hevc @ 0x1f4aca0] Main profile bitstream [hevc @ 0x1f4aca0] Decoding VUI [hevc @ 0x1f4aca0] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f4aca0] Decoding PPS [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] All info found [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1f49980] After avformat_find_stream_info() pos: 20299 bytes read:65595 seeks:2 frames:1 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './Tears_400_x265.mp4': Metadata: major_brand : iso4 minor_version : 1 compatible_brands: iso4hvc1 creation_time : 2014-08-25T18:10:46.000000Z Duration: 00:00:13.96, start: 0.125000, bitrate: 404 kb/s Stream #0:0(und), 1, 1/24000: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 1920x800, 402 kb/s, 24 fps, 24 tbr, 24k tbn, 24 tbc (default) Metadata: creation_time : 2014-08-25T18:10:46.000000Z handler_name : hevc:fps=24@GPAC0.5.1-DEV-rev4807 Successfully opened the file. Parsing a group of options: output url ./out_img/ffmpeg-soft_x265_%d.jpg. Applying option vf (set video filters) with argument fps=1. Successfully parsed a group of options. Opening an output file: ./out_img/ffmpeg-soft_x265_%d.jpg. Successfully opened the file. detected 2 logical cores [hevc @ 0x1f61a00] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f61a00] Decoding VPS [hevc @ 0x1f61a00] Main profile bitstream [hevc @ 0x1f61a00] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f61a00] Decoding SPS [hevc @ 0x1f61a00] Main profile bitstream [hevc @ 0x1f61a00] Decoding VUI [hevc @ 0x1f61a00] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f61a00] Decoding PPS Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> mjpeg (native)) Press [q] to stop, [?] for help cur_dts is invalid (this is harmless if it occurs once at the start per stream) cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0x1f61a00] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f61a00] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f61a00] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f61a00] Decoding SEI [hevc @ 0x1f61a00] Skipped PREFIX SEI 5 [hevc @ 0x1f61a00] Decoding SEI [hevc @ 0x1f61a00] Skipped PREFIX SEI 6 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0x1f7aba0] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f884d0] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f884d0] Output frame with POC 0. [hevc @ 0x1f61a00] Decoded frame with POC 0. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0x1f61a00] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f61a00] Output frame with POC 1. [hevc @ 0x1f7aba0] Decoded frame with POC 5. cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0x1f7aba0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f7aba0] Output frame with POC 2. [hevc @ 0x1f884d0] Decoded frame with POC 3. [Parsed_fps_0 @ 0x1f966c0] Setting 'fps' to value '1' [Parsed_fps_0 @ 0x1f966c0] fps=1/1 [graph 0 input from stream 0:0 @ 0x1f96bb0] Setting 'video_size' to value '1920x800' [graph 0 input from stream 0:0 @ 0x1f96bb0] Setting 'pix_fmt' to value '0' [graph 0 input from stream 0:0 @ 0x1f96bb0] Setting 'time_base' to value '1/24000' [graph 0 input from stream 0:0 @ 0x1f96bb0] Setting 'pixel_aspect' to value '0/1' [graph 0 input from stream 0:0 @ 0x1f96bb0] Setting 'sws_param' to value 'flags=2' [graph 0 input from stream 0:0 @ 0x1f96bb0] Setting 'frame_rate' to value '24/1' [graph 0 input from stream 0:0 @ 0x1f96bb0] w:1920 h:800 pixfmt:yuv420p tb:1/24000 fr:24/1 sar:0/1 sws_param:flags=2 [format @ 0x1f96ad0] compat: called with args=[yuvj420p|yuvj422p|yuvj444p] [format @ 0x1f96ad0] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p' [hevc @ 0x1f61a00] Decoded frame with POC 1. [hevc @ 0x1f7aba0] Decoded frame with POC 2. [auto_scaler_0 @ 0x1f96350] Setting 'flags' to value 'bicubic' [auto_scaler_0 @ 0x1f96350] w:iw h:ih flags:'bicubic' interl:0 [format @ 0x1f96ad0] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_fps_0' and the filter 'format' [AVFilterGraph @ 0x1f962f0] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed [auto_scaler_0 @ 0x1f96350] picking yuvj420p out of 3 ref:yuv420p alpha:0 [swscaler @ 0x2153da0] deprecated pixel format used, make sure you did set range correctly [auto_scaler_0 @ 0x1f96350] w:1920 h:800 fmt:yuv420p sar:0/1 -> w:1920 h:800 fmt:yuvj420p sar:0/1 flags:0x4 [mjpeg @ 0x1f5eba0] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multiple cpu cores [mjpeg @ 0x1f5eba0] intra_quant_bias = 96 inter_quant_bias = 0 Output #0, image2, to './out_img/ffmpeg-soft_x265_%d.jpg': Metadata: major_brand : iso4 minor_version : 1 compatible_brands: iso4hvc1 encoder : Lavf57.71.100 Stream #0:0(und), 0, 1/1: Video: mjpeg, yuvj420p(pc), 1920x800, q=2-31, 200 kb/s, 1 fps, 1 tbn, 1 tbc (default) Metadata: creation_time : 2014-08-25T18:10:46.000000Z handler_name : hevc:fps=24@GPAC0.5.1-DEV-rev4807 encoder : Lavc57.89.100 mjpeg Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0x1f884d0] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0 [hevc @ 0x1f884d0] Output frame with POC 3. [Parsed_fps_0 @ 0x1f966c0] Dropping 1 frame(s). frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x cur_dts is invalid (this is harmless if it occurs once at the start per stream) [Parsed_fps_0 @ 0x1f966c0] Dropping 1 frame(s). [hevc @ 0x1f61a00] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 cur_dts is invalid (this is harmless if it occurs once at the start per stream) [hevc @ 0x1f61a00] Output frame with POC 4. ... No more output streams to write to, finishing. frame= 15 fps=0.5 q=24.8 Lsize=N/A time=00:00:15.00 bitrate=N/A speed=0.451x video:1084kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Input file #0 (./Tears_400_x265.mp4): Input stream #0:0 (video): 335 packets read (701773 bytes); 335 frames decoded; Total: 335 packets (701773 bytes) demuxed Output file #0 (./out_img/ffmpeg-soft_x265_%d.jpg): Output stream #0:0 (video): 15 frames encoded; 15 packets muxed (1109604 bytes); Total: 15 packets (1109604 bytes) muxed bench: utime=52.330s 335 frames successfully decoded, 0 decoding errors bench: maxrss=72480kB [Parsed_fps_0 @ 0x1f966c0] 335 frames in, 15 frames out; 320 frames dropped, 0 frames duplicated. [AVIOContext @ 0x1f52220] Statistics: 734659 bytes read, 2 seeks
      
      





結論





参照資料



[L1] — -1 ;

[L2] — MIPSfpga-plus github ;

[L3] — P-Class P5600 Multiprocessor Core ;

[L4] — MIPS, ;

[L5] — Texas Instruments. Digital Signal Processors ;

[L6] — GPU ;

[L7] — OpenCL. ;

[L8] — Wikipedia: ;

[L9] — TFilter. Free online FIR filter design tool ;

[L10] — Wikipedia: ;

[L11] — Wikipedia: - ;

[L12] — Wikipedia: - ;

[L13] — Wikipedia: SIMD ;

[L14] — Wikipedia: ;

[L15] — MIPS SIMD ;

[L16] — GCC: MIPS SIMD Architecture (MSA) Support ;

[L17] — GCC: MIPS SIMD Architecture Built-in Functions ;

[L18] — ffmpeg github ( libavcodec/mips/) ;

[L19] — FFmpeg multimedia framework ;

[L20] — Codescape MIPS SDK ;

[L21] — H.264 Demo Clips ;

[L22] — x256. Sample HEVC Video Files ;

[L23] — ffmpeg

[L24] — ;







ドキュメント



[D1] — ., . — ;

[D2] — MIPS Architecture for Programmers Volume IV-j: The MIPS32 SIMD Architecture Module ;

[D3] — MIPS SIMD programming. Optimizing multimedia codecs ;







画像と表



[P1] — - -1 . (: L1 );

[P2] — TFilter. 1 ();

[P3] — TFilter. 1 ;

[P4] — TFilter. 2 ();

[P5] — TFilter. 2 ;

[P6] — SIMD- (: D3 );

[P7] — MSA Vector registers (: D2 );

[P8] — MADDV Operation description (: D2 );








All Articles