Lines Matching refs:roq
229 RoqContext *const roq = &enc->common; in eval_motion_dist() local
242 if ((unsigned) mx > roq->width-size || (unsigned) my > roq->height-size) in eval_motion_dist()
245 return block_sse(enc->frame_to_enc->data, roq->last_frame->data, x, y, in eval_motion_dist()
247 enc->frame_to_enc->linesize, roq->last_frame->linesize, in eval_motion_dist()
273 RoqContext *const roq = &enc->common; in create_cel_evals() local
275 enc->cel_evals = av_malloc_array(roq->width * roq->height / 64, sizeof(CelEvaluation)); in create_cel_evals()
280 for (int y = 0, n = 0; y < roq->height; y += 16) in create_cel_evals()
281 for (int x = 0; x < roq->width; x += 16) in create_cel_evals()
349 RoqContext *const roq = &enc->common; in motion_search() local
358 const int max = (roq->width / blocksize) * roq->height / blocksize; in motion_search()
368 for (i = 0; i< roq->height; i += blocksize) in motion_search()
369 for (j = 0; j < roq->width; j += blocksize) { in motion_search()
376 EVAL_MOTION(enc->this_motion8[(i/8) * (roq->width/8) + j/8]); in motion_search()
378 offset = (i/blocksize) * roq->width / blocksize + j / blocksize; in motion_search()
386 offset = (i/blocksize + 1) * roq->width / blocksize + j / blocksize; in motion_search()
390 off[0]= (i/blocksize) * roq->width / blocksize + j/blocksize - 1; in motion_search()
391 off[1]= off[0] - roq->width / blocksize + 1; in motion_search()
420 offset = (i/blocksize) * roq->width / blocksize + j/blocksize; in motion_search()
431 RoqContext *const roq = &enc->common; in gather_data_for_subcel() local
441 subcel->motion = enc->this_motion4[y * roq->width / 16 + x / 4]; in gather_data_for_subcel()
445 enc->this_motion4[y * roq->width / 16 + x / 4], 4); in gather_data_for_subcel()
451 roq->current_frame->data, x, in gather_data_for_subcel()
454 roq->current_frame->linesize, in gather_data_for_subcel()
459 cluster_index = y * roq->width / 16 + x / 4; in gather_data_for_subcel()
496 RoqContext *const roq = &enc->common; in gather_data_for_cel() local
499 int index = cel->sourceY * roq->width / 64 + cel->sourceX/8; in gather_data_for_cel()
515 roq->current_frame->data, in gather_data_for_cel()
519 roq->current_frame->linesize,8); in gather_data_for_cel()
571 RoqContext *const roq = &enc->common; in remap_codebooks() local
581 tempData->codebooks.usedCB2[roq->cb4x4[i].idx[j]]++; in remap_codebooks()
605 RoqContext *const roq = &enc->common; in write_codebooks() local
617 bytestream_put_buffer(outp, roq->cb2x2[tempData->f2i2[i]].y, 4); in write_codebooks()
618 bytestream_put_byte(outp, roq->cb2x2[tempData->f2i2[i]].u); in write_codebooks()
619 bytestream_put_byte(outp, roq->cb2x2[tempData->f2i2[i]].v); in write_codebooks()
624 bytestream_put_byte(outp, tempData->i2f2[roq->cb4x4[tempData->f2i4[i]].idx[j]]); in write_codebooks()
662 RoqContext *const roq = &enc->common; in reconstruct_and_encode_image() local
704 ff_apply_motion_8x8(roq, x, y, in reconstruct_and_encode_image()
712 qcell = roq->cb4x4 + eval->cbEntry; in reconstruct_and_encode_image()
713 ff_apply_vector_4x4(roq, x , y , roq->cb2x2 + qcell->idx[0]); in reconstruct_and_encode_image()
714 ff_apply_vector_4x4(roq, x+4, y , roq->cb2x2 + qcell->idx[1]); in reconstruct_and_encode_image()
715 ff_apply_vector_4x4(roq, x , y+4, roq->cb2x2 + qcell->idx[2]); in reconstruct_and_encode_image()
716 ff_apply_vector_4x4(roq, x+4, y+4, roq->cb2x2 + qcell->idx[3]); in reconstruct_and_encode_image()
734 ff_apply_motion_4x4(roq, subX, subY, in reconstruct_and_encode_image()
743 qcell = roq->cb4x4 + eval->subCels[j].cbEntry; in reconstruct_and_encode_image()
745 ff_apply_vector_2x2(roq, subX , subY , in reconstruct_and_encode_image()
746 roq->cb2x2 + qcell->idx[0]); in reconstruct_and_encode_image()
747 ff_apply_vector_2x2(roq, subX+2, subY , in reconstruct_and_encode_image()
748 roq->cb2x2 + qcell->idx[1]); in reconstruct_and_encode_image()
749 ff_apply_vector_2x2(roq, subX , subY+2, in reconstruct_and_encode_image()
750 roq->cb2x2 + qcell->idx[2]); in reconstruct_and_encode_image()
751 ff_apply_vector_2x2(roq, subX+2, subY+2, in reconstruct_and_encode_image()
752 roq->cb2x2 + qcell->idx[3]); in reconstruct_and_encode_image()
761 ff_apply_vector_2x2(roq, subX + 2*(k&1), subY + (k&2), in reconstruct_and_encode_image()
762 roq->cb2x2 + cb_idx); in reconstruct_and_encode_image()
852 RoqContext *const roq = &enc->common; in generate_new_codebooks() local
853 int max = roq->width * roq->height / 16; in generate_new_codebooks()
858 create_clusters(enc->frame_to_enc, roq->width, roq->height, points); in generate_new_codebooks()
869 roq->cb2x2, 2, MAX_CBS_2x2)) < 0) in generate_new_codebooks()
876 unpack_roq_cell(roq->cb2x2 + i, codebooks->unpacked_cb2 + i*2*2*3); in generate_new_codebooks()
883 &roq->cb4x4[i].idx[j], 2); in generate_new_codebooks()
885 unpack_roq_qcell(codebooks->unpacked_cb2, roq->cb4x4 + i, in generate_new_codebooks()
897 RoqContext *const roq = &enc->common; in roq_encode_video() local
912 for (int i = 0; i < roq->width * roq->height / 64; i++) in roq_encode_video()
918 av_log(roq->avctx, AV_LOG_ERROR, "Cannot encode video in Quake compatible form\n"); in roq_encode_video()
921 av_log(roq->avctx, AV_LOG_ERROR, in roq_encode_video()
940 reconstruct_and_encode_image(enc, roq->width, roq->height, in roq_encode_video()
941 roq->width * roq->height / 64); in roq_encode_video()
944 FFSWAP(AVFrame *, roq->current_frame, roq->last_frame); in roq_encode_video()
973 RoqContext *const roq = &enc->common; in roq_encode_init() local
977 roq->avctx = avctx; in roq_encode_init()
993 roq->width = avctx->width; in roq_encode_init()
994 roq->height = avctx->height; in roq_encode_init()
999 roq->last_frame = av_frame_alloc(); in roq_encode_init()
1000 roq->current_frame = av_frame_alloc(); in roq_encode_init()
1001 if (!roq->last_frame || !roq->current_frame) in roq_encode_init()
1005 av_mallocz_array(roq->width * roq->height / 16, sizeof(motion_vect)); in roq_encode_init()
1008 av_malloc_array (roq->width * roq->height / 16, sizeof(motion_vect)); in roq_encode_init()
1011 av_mallocz_array(roq->width * roq->height / 64, sizeof(motion_vect)); in roq_encode_init()
1014 av_malloc_array (roq->width * roq->height / 64, sizeof(motion_vect)); in roq_encode_init()
1019 av_malloc_array(roq->width * roq->height, 3 * sizeof(int)); in roq_encode_init()
1025 enc->points = enc->closest_cb + roq->width * roq->height * 3 / 2; in roq_encode_init()
1059 RoqContext *const roq = &enc->common; in roq_encode_frame() local
1062 roq->avctx = avctx; in roq_encode_frame()
1073 size = ((roq->width * roq->height / 64) * 138 + 7) / 8 + 256 * (6 + 4) + 8; in roq_encode_frame()
1085 if ((ret = ff_get_buffer(avctx, roq->current_frame, 0)) < 0 || in roq_encode_frame()
1086 (ret = ff_get_buffer(avctx, roq->last_frame, 0)) < 0) in roq_encode_frame()