libaom 源码分析线程结构

一 libaom线程启动函数

void av1_create_workers(AV1_PRIMARY *ppi, int num_workers)

{

PrimaryMultiThreadInfo *const p_mt_info = &ppu->p_mt_info;

const AVxWorkerInterface *const = winterface = aom_get_worker_interface();

for (int i = 0; i < num_workers; ++i) {

AVxWorker* const worker = &p_mt_info->workers[i];

EncWorkerData *const thread_data = &p_mt_info->tile_thr_data[i];

winterface->init(worker);

worker->thread_nae = "aom enc worker";

thread_data->thread_id = i;

thread_data->start = i;

if (i > 0) {

if (!winterface->reset(worker))

aom_internal_error(&ppi->error, AOM_CODEC_ERROR, "Tile encoder thread creation failed");

}

}

winterface->sync(worker);

++p_mt_info->num_workers;

}

二 libaom线程调用栈

#0 in full_pixel_diamond()

#1 0x000000000058ee91 in av1_full_pixel_search ()

firstpass_inter_prediction->first_pass_motion_search

#2 0x000000000057d22c in av1_first_pass_row ()

#3 0x0000000000571124 in fp_enc_row_mt_worker_hook ()

#4 0x0000000000be5ef7 in execute ()

#5 0x00000000005788c8 in av1_fp_encode_tiles_row_mt ()

#6 0x000000000057ea03 in av1_first_pass ()

#7 0x00000000005625c0 in av1_encode ()

#8 0x0000000000c8036f in av1_encode_strategy ()

#9 0x00000000005636eb in av1_get_compressed_data ()

#10 0x00000000004ff0fb in encoder_encode ()

#11 0x00000000004bca0a in aom_codec_encode ()

#12 0x000000000040af05 in encode_frame.isra ()

#13 0x000000000040786c in main ()

三 libaom 线程调用关系

void av1_first_pass_row(AV1_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, const int unit_row, const BLOCK_SIZE fp_block_size) ->

firstpass_inter_prediction(cpi, td, last_frame, golden_frame, unit_row, unit_col, recon_yoffset, recon_uvoffset, src_yoffset, fp_block_size, this_intra_error, raw_motion_err_counts, raw_motion_err_list, best_ref_mv, &best_ref_mv, &last_mv, mb_stats);

firstpass_intra_prediction()

线程入口函数

//定义一个静态整型函数用于多线程编码工作钩子

static int fp_enc_row_mt_worker_hook(void *arg1, void *unused)

{

//传入arg1转换EncWorkerData类型这个结构包含了线程数据

EncWorkerData *const t

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值