feat(ncm): 网易云技术栈预研+构建验证 (agent-200) — 选型: mbedtls3.6.2裁剪(TLS+AES+MD5+RSA raw+Base64,~388KB)/jsmn(2.2KB)/qrcodegen(10.8KB)/minimp3(37.4KB), 合计~438KB; HTTPS unikey 全链路宿主+qemu-mipsel 实测通过; RSA raw 与 Python pow 逐字节一致; MP3 解码非瓶颈
vendor源码+out产物不入库(126MB, gitignore; 版本/许可/裁剪见 VENDOR_NOTES.md, build_*.sh 可复现)
This commit is contained in:
1 parent
2d93298f8a
commit
c96e912518
19 files changed
+733
No files matched your search
Executable
BIN
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
#define DR_MP3_IMPLEMENTATION
|
||||
#include "dr_mp3.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
static double now(){ struct timespec ts; clock_gettime(CLOCK_MONOTONIC,&ts); return ts.tv_sec+ts.tv_nsec*1e-9; }
|
||||
int main(int argc,char**argv){
|
||||
if(argc<2){fprintf(stderr,"usage: %s file.mp3\n",argv[0]);return 1;}
|
||||
drmp3 d; if(!drmp3_init_file(&d,argv[1],NULL)){fprintf(stderr,"open fail\n");return 1;}
|
||||
printf("rate=%d ch=%d\n",d.sampleRate,d.channels);
|
||||
float *pcm=malloc(2048*2*sizeof(float));
|
||||
double t0=now(); long long frames=0; drmp3_uint64 n;
|
||||
while((n=drmp3_read_pcm_frames_f32(&d,2048,pcm))!=0){ frames+=n; }
|
||||
double t1=now();
|
||||
printf("total_pcm_frames=%lld\n",frames);
|
||||
printf("wall=%.3f s throughput=%.1f xRT (%.1f frames/s)\n",(t1-t0),
|
||||
(double)frames/d.sampleRate/(t1-t0),(double)frames/(t1-t0));
|
||||
drmp3_uninit(&d); free(pcm); return 0;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
#define MINIMP3_IMPLEMENTATION
|
||||
#include "minimp3_ex.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
static double now(){ struct timespec ts; clock_gettime(CLOCK_MONOTONIC,&ts); return ts.tv_sec+ts.tv_nsec*1e-9; }
|
||||
int main(int argc,char**argv){
|
||||
if(argc<2){fprintf(stderr,"usage: %s file.mp3\n",argv[0]);return 1;}
|
||||
mp3dec_t dec; mp3dec_init(&dec);
|
||||
mp3dec_file_info_t info; memset(&info,0,sizeof info);
|
||||
double t0=now(); int r=mp3dec_load(&dec,argv[1],&info,NULL,NULL); double t1=now();
|
||||
if(r){fprintf(stderr,"decode fail %d\n",r);return 1;}
|
||||
long long frames=info.samples/info.channels;
|
||||
printf("rate=%d ch=%d total_pcm_frames=%lld\n",info.hz,info.channels,frames);
|
||||
printf("wall=%.3f s throughput=%.1f xRT (%.1f frames/s)\n",(t1-t0),
|
||||
(double)frames/info.hz/(t1-t0),(double)frames/(t1-t0));
|
||||
free(info.buffer); return 0;
|
||||
}
|
||||
Reference in new issue
Block a user