project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | e62b3dd210f19c337fc541758079fceeadabc208 | 0 | static int encode_block(SVQ1Context *s, uint8_t *src, uint8_t *ref, uint8_t *decoded, int stride, int level, int threshold, int lambda, int intra){
int count, y, x, i, j, split, best_mean, best_score, best_count;
int best_vector[6];
int block_sum[7]= {0, 0, 0, 0, 0, 0};
int w= 2<<((level+2)>>1);
... | 18,369 |
FFmpeg | 5d5de3eba4c7890c2e8077f5b4ae569671d11cf8 | 0 | int ff_v4l2_context_dequeue_frame(V4L2Context* ctx, AVFrame* frame)
{
V4L2Buffer* avbuf = NULL;
/* if we are draining, we are no longer inputing data, therefore enable a
* timeout so we can dequeue and flag the last valid buffer.
*
* blocks until:
* 1. decoded frame available
... | 18,370 |
FFmpeg | c988f97566cdf536ba0dcbc0d77d885456852060 | 0 | int ff_h264_decode_mb_cabac(H264Context *h) {
MpegEncContext * const s = &h->s;
int mb_xy;
int mb_type, partition_count, cbp = 0;
int dct8x8_allowed= h->pps.transform_8x8_mode;
mb_xy = h->mb_xy = s->mb_x + s->mb_y*s->mb_stride;
tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb... | 18,372 |
FFmpeg | 7fb4b0368de18fc150e72a9190a4c87827d2d9d2 | 1 | static int parse_read_interval(const char *interval_spec,
ReadInterval *interval)
{
int ret = 0;
char *next, *p, *spec = av_strdup(interval_spec);
if (!spec)
return AVERROR(ENOMEM);
if (!*spec) {
av_log(NULL, AV_LOG_ERROR, "Invalid empty interval ... | 18,373 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | static uint32_t qvirtio_pci_get_guest_features(QVirtioDevice *d)
{
QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
return qpci_io_readl(dev->pdev, dev->addr + VIRTIO_PCI_GUEST_FEATURES);
}
| 18,374 |
qemu | a8f2e5c8fffbaf7fbd4f0efc8efbeebade78008f | 1 | bool virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req)
{
VirtIOSCSICommon *vs = &s->parent_obj;
SCSIDevice *d;
int rc;
rc = virtio_scsi_parse_req(req, sizeof(VirtIOSCSICmdReq) + vs->cdb_size,
sizeof(VirtIOSCSICmdResp) + vs->sense_size);
if ... | 18,375 |
FFmpeg | fd34dbea58e097609ff09cf7dcc59f74930195d3 | 1 | static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid)
{
MXFContext *mxf = arg;
int item_num = avio_rb32(pb);
int item_len = avio_rb32(pb);
if (item_len != 18) {
av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\n");
return -1;
... | 18,376 |
qemu | 870f5681c9dbafc738082b1fd48e0cc013bf43c7 | 1 | void qmp_transaction(BlockdevActionList *dev_list, Error **errp)
{
int ret = 0;
BlockdevActionList *dev_entry = dev_list;
BlkTransactionStates *states, *next;
QSIMPLEQ_HEAD(snap_bdrv_states, BlkTransactionStates) snap_bdrv_states;
QSIMPLEQ_INIT(&snap_bdrv_states);
/* drain all i/o bef... | 18,377 |
FFmpeg | 5b0ae88ca6b3eb85dbda1762f16f1b5e7c3aa014 | 1 | static int genh_read_header(AVFormatContext *s)
{
unsigned start_offset, header_size, codec, coef_type, coef[2];
GENHDemuxContext *c = s->priv_data;
av_unused unsigned coef_splitted[2];
int align, ch, ret;
AVStream *st;
avio_skip(s->pb, 4);
st = avformat_new_stream(s, NULL);
... | 18,378 |
qemu | e3c9d76acc984218264bbc6435b0c09f959ed9b8 | 1 | static void virtio_scsi_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
dc->exit = virtio_scsi_device_exit;
dc->props = virtio_scsi_properties;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
vdc->i... | 18,379 |
FFmpeg | 3b8617429014301b26b587a5e537910746d3377a | 1 | static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
Jpeg2000CodingStyle *codsty,
Jpeg2000ResLevel *rlevel, int precno,
int layno, uint8_t *expn, int numgbits)
{
int bandno, cblkno, ret, nb_code_blocks... | 18,380 |
qemu | 702dbcc274e2ca43be20ba64c758c0ca57dab91d | 1 | void v9fs_device_unrealize_common(V9fsState *s, Error **errp)
{
g_free(s->tag);
g_free(s->ctx.fs_root);
| 18,381 |
qemu | 93bd49aff9081bbe9440192db9da3676941f77a3 | 1 | void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
HandleOutput ctrl, HandleOutput evt,
HandleOutput cmd)
{
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
VirtIOSCSICommon *s = VIRTIO_SCSI_COMMON(dev);
int i;
virtio_init(vde... | 18,382 |
FFmpeg | 60f50374f1955442dc987abc4a6c61c2109620c2 | 0 | static int rpza_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
RpzaContext *s = avctx->priv_data;
int ret;
bytestream2_init(&s->gb, avpkt->data, avpkt->size);
if ((ret = ff_reget_buffer(avctx, s->fra... | 18,383 |
FFmpeg | e4d4044339b9c3b0f45f7203cd026eda3c0414c0 | 1 | static int decode_cell_data(Cell *cell, uint8_t *block, uint8_t *ref_block,
int pitch, int h_zoom, int v_zoom, int mode,
const vqEntry *delta[2], int swap_quads[2],
const uint8_t **data_ptr, const uint8_t *last_ptr)
{
int ... | 18,385 |
qemu | 14a10fc39923b3af07c8c46d22cb20843bee3a72 | 1 | static void superh_cpu_realizefn(DeviceState *dev, Error **errp)
{
SuperHCPU *cpu = SUPERH_CPU(dev);
SuperHCPUClass *scc = SUPERH_CPU_GET_CLASS(dev);
cpu_reset(CPU(cpu));
scc->parent_realize(dev, errp);
}
| 18,386 |
FFmpeg | 7434ba6d53b9a8858a6f965d9a4e60b5eb1316fe | 1 | static void http_log(char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
if (logfile)
vfprintf(logfile, fmt, ap);
va_end(ap);
}
| 18,387 |
qemu | 8bcbf37caa87ba89bc391bad70039f942a98c7e3 | 1 | void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip)
{
const ARMCPRegInfo *ri = rip;
switch (ri->accessfn(env, ri)) {
case CP_ACCESS_OK:
return;
case CP_ACCESS_TRAP:
case CP_ACCESS_TRAP_UNCATEGORIZED:
/* These cases will eventually need to generate different
... | 18,388 |
FFmpeg | 82dd7d0dec29ee59af91ce18c29eb151b363ff37 | 0 | static void skip_block (uint8_t *current, uint8_t *previous, int pitch, int x, int y) {
uint8_t *src;
uint8_t *dst;
int i;
src = &previous[x + y*pitch];
dst = current;
for (i=0; i < 16; i++) {
memcpy (dst, src, 16);
src += pitch;
dst += pitch;
}
}
| 18,389 |
FFmpeg | 2a672652bb70fe6ae1c711f80678f9a513732ee1 | 1 | static int mlp_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
MLPParseContext *mp = s->priv_data;
int sync_present;
uint8_t parity_bits;
int next;... | 18,391 |
qemu | 697ab892786d47008807a49f57b2fd86adfcd098 | 1 | void ppc_translate_init(void)
{
int i;
char* p;
size_t cpu_reg_names_size;
static int done_init = 0;
if (done_init)
return;
cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env");
p = cpu_reg_names;
cpu_reg_names_size = sizeof(cpu_reg_names);
for (i = 0; i < 8; i++) {
snp... | 18,392 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | void qusb_pci_init_one(QPCIBus *pcibus, struct qhc *hc, uint32_t devfn, int bar)
{
hc->dev = qpci_device_find(pcibus, devfn);
g_assert(hc->dev != NULL);
qpci_device_enable(hc->dev);
hc->base = qpci_iomap(hc->dev, bar, NULL);
g_assert(hc->base != NULL);
}
| 18,393 |
FFmpeg | 40393ac568db345b0388e1c99fc89f41a5b08037 | 1 | static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track)
{
const char *hdlr, *descr = NULL, *hdlr_type = NULL;
int64_t pos = avio_tell(pb);
if (!track) { /* no media --> data handler */
hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0";
if (track->enc->codec_type == A... | 18,394 |
qemu | 0c9390d978cbf61e8f16c9f580fa96b305c43568 | 1 | static coroutine_fn void nbd_co_client_start(void *opaque)
{
NBDClientNewData *data = opaque;
NBDClient *client = data->client;
NBDExport *exp = client->exp;
if (exp) {
nbd_export_get(exp);
QTAILQ_INSERT_TAIL(&exp->clients, client, next);
}
qemu_co_mutex_init(&client->... | 18,395 |
qemu | 36802b6b1ed7887aeae5d027f86a969400f8824a | 1 | static inline int vfp_exceptbits_from_host(int host_bits)
{
int target_bits = 0;
if (host_bits & float_flag_invalid)
target_bits |= 1;
if (host_bits & float_flag_divbyzero)
target_bits |= 2;
if (host_bits & float_flag_overflow)
target_bits |= 4;
if (host_bits & flo... | 18,396 |
qemu | 302fa283789a2f9b1199c327047cfad2258a23a2 | 1 | const char *memory_region_name(const MemoryRegion *mr)
{
return object_get_canonical_path_component(OBJECT(mr));
}
| 18,397 |
FFmpeg | b8b8e82ea14016b2cb04b49ecea57f836e6ee7f8 | 1 | static int dnxhd_decode_macroblock(const DNXHDContext *ctx, RowContext *row,
AVFrame *frame, int x, int y)
{
int shift1 = ctx->bit_depth == 10;
int dct_linesize_luma = frame->linesize[0];
int dct_linesize_chroma = frame->linesize[1];
uint8_t *dest_y, *dest_u, *... | 18,398 |
FFmpeg | e6bc38fd49c94726b45d5d5cc2b756ad8ec49ee0 | 1 | static void wmv2_idct_col(short * b)
{
int s1,s2;
int a0,a1,a2,a3,a4,a5,a6,a7;
/*step 1, with extended precision*/
a1 = (W1*b[8*1]+W7*b[8*7] + 4)>>3;
a7 = (W7*b[8*1]-W1*b[8*7] + 4)>>3;
a5 = (W5*b[8*5]+W3*b[8*3] + 4)>>3;
a3 = (W3*b[8*5]-W5*b[8*3] + 4)>>3;
a2 = (W2*b[8*2]+W6*b[8*6... | 18,399 |
qemu | 0ca4f94195cce77b624edc6d9abcf14a3bf01f06 | 1 | static void bonito_writel(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
PCIBonitoState *s = opaque;
uint32_t saddr;
int reset = 0;
saddr = (addr - BONITO_REGBASE) >> 2;
DPRINTF("bonito_writel "TARGET_FMT_plx" val %x saddr %x\n", addr, val, saddr);
... | 18,400 |
FFmpeg | ba728c1a2527a02f239fdfaf118a618b758721db | 1 | static int init_resampler(AVCodecContext *input_codec_context,
AVCodecContext *output_codec_context,
SwrContext **resample_context)
{
/**
* Only initialize the resampler if it is necessary, i.e.,
* if and only if the sample formats differ.
*/... | 18,401 |
qemu | 7fc5b13fd7b05babc7bcad9dcb8281ae202a9494 | 1 | static int qemu_rdma_dest_init(RDMAContext *rdma, Error **errp)
{
int ret = -EINVAL, idx;
struct rdma_cm_id *listen_id;
char ip[40] = "unknown";
struct addrinfo *res;
char port_str[16];
for (idx = 0; idx < RDMA_WRID_MAX; idx++) {
rdma->wr_data[idx].control_len = 0;
rdm... | 18,403 |
FFmpeg | 1121d9270783b284a70af317d8785eac7df1b72f | 1 | static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64])
{
int cbp, code, i;
uint32_t * const mb_type_ptr = &s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride];
if (s->pict_type == AV_PICTURE_TYPE_P) {
if (s->use_skip_mb_code) {
if (get_bits1(&s->gb)) {
... | 18,404 |
FFmpeg | 12936a4585bc293c0f88327d6840f49e8e744b62 | 1 | static int decode_tsw1(GetByteContext *gb, uint8_t *frame, int width, int height)
{
const uint8_t *frame_start = frame;
const uint8_t *frame_end = frame + width * height;
int mask = 0x10000, bitbuf = 0;
int v, count, segments;
unsigned offset;
segments = bytestream2_get_le32(gb);
... | 18,406 |
FFmpeg | 0da6315a70396572319e6e8726159b6f4f3ead3f | 1 | static int qpel_motion_search(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int dmin,
int src_index, int ref_index,
int size, int h)
{
MotionEstContext * const c= &s->me;
const int mx = *mx_ptr;
... | 18,407 |
qemu | d59ce6f34434bf47a9b26138c908650bf9a24be1 | 1 | void migrate_fd_error(MigrationState *s)
{
trace_migrate_fd_error();
assert(s->to_dst_file == NULL);
migrate_set_state(&s->state, MIGRATION_STATUS_SETUP,
MIGRATION_STATUS_FAILED);
notifier_list_notify(&migration_state_notifiers, s);
}
| 18,408 |
qemu | 3e48dd4a2d48aabafe22ce3611d65544d0234a69 | 1 | static uint32_t rtl8139_TxStatus_read(RTL8139State *s, uint8_t addr, int size)
{
uint32_t reg = (addr - TxStatus0) / 4;
uint32_t offset = addr & 0x3;
uint32_t ret = 0;
if (addr & (size - 1)) {
DPRINTF("not implemented read for TxStatus addr=0x%x size=0x%x\n", addr,
size)... | 18,410 |
FFmpeg | a82468514048fb87d9bf38689866bc3b9aaccd02 | 1 | static int decode_gop_header(IVI45DecContext *ctx, AVCodecContext *avctx)
{
int result, i, p, tile_size, pic_size_indx, mb_size, blk_size, is_scalable;
int quant_mat, blk_size_changed = 0;
IVIBandDesc *band, *band1, *band2;
IVIPicConfig pic_conf;
ctx->gop_flags... | 18,414 |
qemu | 7f3be0f20ff8d976ab982cc06026cac0600f1fb6 | 1 | static void virtio_gpu_cleanup_mapping(struct virtio_gpu_simple_resource *res)
{
virtio_gpu_cleanup_mapping_iov(res->iov, res->iov_cnt);
g_free(res->iov);
res->iov = NULL;
res->iov_cnt = 0;
}
| 18,415 |
FFmpeg | add41decd94b2d3581a3715ba10f27168b8cdb1b | 0 | static int get_packet(URLContext *s, int for_header)
{
RTMPContext *rt = s->priv_data;
int ret;
uint8_t *p;
const uint8_t *next;
uint32_t data_size;
uint32_t ts, cts, pts=0;
if (rt->state == STATE_STOPPED)
return AVERROR_EOF;
for (;;) {
RTMPPacket rpkt = { ... | 18,416 |
FFmpeg | 06af335a33a771bad05dc1873c3f9d8e84abfb45 | 0 | static int pcm_encode_frame(AVCodecContext *avctx,
unsigned char *frame, int buf_size, void *data)
{
int n, sample_size, v;
const short *samples;
unsigned char *dst;
const uint8_t *srcu8;
const int16_t *samples_int16_t;
const int32_t *samples_int32_t;
con... | 18,417 |
FFmpeg | ce87711df563a9d2d0537a062b86bb91b15ea1a0 | 0 | static int exif_add_metadata(AVCodecContext *avctx, int count, int type,
const char *name, const char *sep,
GetByteContext *gb, int le,
AVDictionary **metadata)
{
switch(type) {
case 0:
av_log(avctx, AV_LOG_WAR... | 18,418 |
FFmpeg | 87e8788680e16c51f6048af26f3f7830c35207a5 | 0 | static int mtv_probe(AVProbeData *p)
{
if(p->buf_size < 3)
return 0;
/* Magic is 'AMV' */
if(*(p->buf) != 'A' || *(p->buf+1) != 'M' || *(p->buf+2) != 'V')
return 0;
return AVPROBE_SCORE_MAX;
}
| 18,420 |
FFmpeg | 87e8788680e16c51f6048af26f3f7830c35207a5 | 0 | static int vmd_probe(AVProbeData *p)
{
if (p->buf_size < 2)
return 0;
/* check if the first 2 bytes of the file contain the appropriate size
* of a VMD header chunk */
if (AV_RL16(&p->buf[0]) != VMD_HEADER_SIZE - 2)
return 0;
/* only return half certainty since this chec... | 18,421 |
FFmpeg | f61cbc22d3ce8ec0e2644d0fa565413c057deaa0 | 0 | voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
{
VocDecContext *voc = s->priv_data;
AVCodecContext *dec = st->codec;
ByteIOContext *pb = s->pb;
VocType type;
int size, tmp_codec;
int sample_rate = 0;
int channels = 1;
while (!voc->remaining_size)... | 18,422 |
FFmpeg | 6d6eabd399eb20b69d10234ef746f2d3d4c72dcb | 1 | static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index)
{
int code;
code = get_vlc2(&s->gb, s->vlcs[0][dc_index].table, 9, 2);
if (code < 0) {
av_log(s->avctx, AV_LOG_WARNING,
"mjpeg_decode_dc: bad vlc: %d:%d (%p)\n",
0, dc_index, &s->vlcs[0][dc_in... | 18,423 |
qemu | f8ed85ac992c48814d916d5df4d44f9a971c5de4 | 1 | static void palmte_init(MachineState *machine)
{
const char *cpu_model = machine->cpu_model;
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename;
MemoryRegion *address_space_mem = g... | 18,424 |
qemu | baf35cb90204d75404892aa4e52628ae7a00669b | 1 | static void aio_signal_handler(int signum)
{
#if !defined(QEMU_IMG) && !defined(QEMU_NBD)
CPUState *env = cpu_single_env;
if (env) {
/* stop the currently executing cpu because a timer occured */
cpu_interrupt(env, CPU_INTERRUPT_EXIT);
#ifdef USE_KQEMU
if (env->kqemu_enabled) {
... | 18,428 |
FFmpeg | db42d93a61be26873be6115c57f5921b4dfdec14 | 1 | static int mov_read_mfra(MOVContext *c, AVIOContext *f)
{
int64_t stream_size = avio_size(f);
int64_t original_pos = avio_tell(f);
int64_t seek_ret;
int32_t mfra_size;
int ret = -1;
if ((seek_ret = avio_seek(f, stream_size - 4, SEEK_SET)) < 0) {
ret = seek_ret;
goto fail... | 18,429 |
qemu | f68945d42bab700d95b87f62e0898606ce2421ed | 1 | static int qemu_save_device_state(QEMUFile *f)
{
SaveStateEntry *se;
qemu_put_be32(f, QEMU_VM_FILE_MAGIC);
qemu_put_be32(f, QEMU_VM_FILE_VERSION);
cpu_synchronize_all_states();
QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
if (se->is_ram) {
continue;
}
if ((... | 18,430 |
FFmpeg | f5b2476fd322a4d36fde912cb2a30a850bd77f43 | 1 | void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src,
int stride, int h, int x, int y) {
POWERPC_PERF_DECLARE(PREFIX_h264_chroma_mc8_num, 1);
DECLARE_ALIGNED_16(signed int, ABCD[4]) =
{((8 - x) * (8 - y)),
(( ... | 18,431 |
FFmpeg | 3f07dd6e392bf35a478203dc60fcbd36dfdd42aa | 1 | static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd, const char **p,
int line_num, FFServerStream **pstream)
{
char arg[1024], arg2[1024];
FFServerStream *stream;
int val;
av_assert0(pstream);
stream = *pstream;
if (... | 18,432 |
qemu | 6860710cc3864382a898c847d722f950b5e01a6e | 1 | static inline abi_long host_to_target_sockaddr(abi_ulong target_addr,
struct sockaddr *addr,
socklen_t len)
{
struct target_sockaddr *target_saddr;
if (len == 0) {
return 0;
}
target_saddr ... | 18,433 |
qemu | 6152e2ae4344ec8c849393da3f76f2263cc55766 | 1 | void kvm_set_phys_mem(target_phys_addr_t start_addr,
ram_addr_t size,
ram_addr_t phys_offset)
{
KVMState *s = kvm_state;
ram_addr_t flags = phys_offset & ~TARGET_PAGE_MASK;
KVMSlot *mem;
if (start_addr & ~TARGET_PAGE_MASK) {
fprintf(stderr, "... | 18,434 |
qemu | 3a4dbe6aa934370a92372528c1255ee1504965ee | 1 | static void vfio_put_device(VFIOPCIDevice *vdev)
{
g_free(vdev->vbasedev.name);
if (vdev->msix) {
g_free(vdev->msix);
vdev->msix = NULL;
}
vfio_put_base_device(&vdev->vbasedev);
} | 18,435 |
qemu | 1e7398a140f7a6bd9f5a438e7ad0f1ef50990e25 | 1 | static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
const char *model, const char *name,
const char *ifname, const char *script,
const char *downscript, const char *vhostfdname,
... | 18,436 |
qemu | facf98ad987a38d97e12511f81375380b407a828 | 1 | void qemu_iovec_concat_iov(QEMUIOVector *dst,
struct iovec *src_iov, unsigned int src_cnt,
size_t soffset, size_t sbytes)
{
int i;
size_t done;
assert(dst->nalloc != -1);
for (i = 0, done = 0; done < sbytes && i < src_cnt; i++) {
if (soffset ... | 18,440 |
qemu | b53ccc30c40df52d192e469a86c188a8649c6df3 | 1 | void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
{
Error *errp = NULL;
int paging = qdict_get_try_bool(qdict, "paging", 0);
const char *file = qdict_get_str(qdict, "filename");
bool has_begin = qdict_haskey(qdict, "begin");
bool has_length = qdict_haskey(qdict, "length");
int6... | 18,441 |
FFmpeg | c8aee695c50f879186ca5f9cbaefb076a0d0343f | 1 | static int encode_picture_ls(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
JpeglsContext * const s = avctx->priv_data;
AVFrame *pict = data;
AVFrame * const p= (AVFrame*)&s->picture;
const int near = avctx->prediction_method;
PutBitContext pb, pb2;
GetBitContext gb;... | 18,442 |
FFmpeg | 04cfef21ff25e30005d3b2a42bc145324e580a2f | 1 | void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int endy, int status){
const int start_i= clip(startx + starty * s->mb_width , 0, s->mb_num-1);
const int end_i = clip(endx + endy * s->mb_width , 0, s->mb_num);
const int start_xy= s->mb_index2xy[start_i];
const int en... | 18,443 |
FFmpeg | 33d6f90e3e0241939ea0be9ca9e1f335942081c8 | 0 | static int rtsp_parse_request(HTTPContext *c)
{
const char *p, *p1, *p2;
char cmd[32];
char url[1024];
char protocol[32];
char line[1024];
int len;
RTSPMessageHeader header1 = { 0 }, *header = &header1;
c->buffer_ptr[0] = '\0';
p = c->buffer;
get_word(cmd, sizeof(c... | 18,444 |
qemu | 5e5a94b60518002e8ecc7afa78a9e7565b23e38f | 1 | bdrv_acct_done(BlockDriverState *bs, BlockAcctCookie *cookie)
{
assert(cookie->type < BDRV_MAX_IOTYPE);
bs->stats.nr_bytes[cookie->type] += cookie->bytes;
bs->stats.nr_ops[cookie->type]++;
bs->stats.total_time_ns[cookie->type] += get_clock() -
cookie-... | 18,445 |
FFmpeg | c23acbaed40101c677dfcfbbfe0d2c230a8e8f44 | 1 | static inline void idct4row(DCTELEM *row)
{
int c0, c1, c2, c3, a0, a1, a2, a3;
//const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
a0 = row[0];
a1 = row[1];
a2 = row[2];
a3 = row[3];
c0 = (a0 + a2)*R3 + (1 << (R_SHIFT - 1));
c2 = (a0 - a2)*R3 + (1 << (R_SHIFT - 1));
c1 = a1... | 18,446 |
FFmpeg | 75511c293add07db1cca58dcd8b08c33fc2f1075 | 1 | static void dump_stream_format(AVFormatContext *ic, int i,
int index, int is_output)
{
char buf[256];
int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
AVStream *st = ic->streams[i];
int g = av_gcd(st->time_base.num, st->time_base.den);
AVDictionaryEnt... | 18,448 |
qemu | 15ff7705444ab9663189946d6d648431e0649df1 | 1 | int rom_load_all(void)
{
target_phys_addr_t addr = 0;
int memtype;
Rom *rom;
QTAILQ_FOREACH(rom, &roms, next) {
if (addr < rom->min)
addr = rom->min;
if (rom->max) {
/* load address range */
if (rom->align) {
addr += (rom->... | 18,449 |
qemu | eb2f9b024d68884a3b25e63e4dbf90b67f8da236 | 1 | static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
{
uint32_t caps;
struct vmsvga_state_s *s = opaque;
DisplaySurface *surface = qemu_console_surface(s->vga.con);
uint32_t ret;
switch (s->index) {
case SVGA_REG_ID:
ret = s->svgaid;
break;
case SVG... | 18,450 |
qemu | 2b76bdc965ba7b4f27133cb345101d9535ddaa79 | 1 | static uint32_t pxa2xx_gpio_read(void *opaque, target_phys_addr_t offset)
{
struct pxa2xx_gpio_info_s *s = (struct pxa2xx_gpio_info_s *) opaque;
uint32_t ret;
int bank;
offset -= s->base;
if (offset >= 0x200)
return 0;
bank = pxa2xx_gpio_regs[offset].bank;
switch (pxa2xx_gpio_regs[of... | 18,452 |
FFmpeg | 7f526efd17973ec6d2204f7a47b6923e2be31363 | 1 | void rgb24tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size)
{
unsigned i;
for(i=0; 3*i<src_size; i++)
{
dst[4*i + 0] = src[3*i + 2];
dst[4*i + 1] = src[3*i + 1];
dst[4*i + 2] = src[3*i + 0];
dst[4*i + 3] = 0;
}
}
| 18,453 |
qemu | 373166636b9f07c60d7c32610bd346acf7d143e9 | 1 | int qcrypto_init(Error **errp)
{
#ifdef CONFIG_GNUTLS
int ret;
ret = gnutls_global_init();
if (ret < 0) {
error_setg(errp,
"Unable to initialize GNUTLS library: %s",
gnutls_strerror(ret));
return -1;
}
#ifdef DEBUG_GNUTLS
gnutls_globa... | 18,454 |
FFmpeg | 18ce63a60e1bffc35b4df5d8a4f9a1ff1a96cb9a | 1 | libAVFilter_QueryVendorInfo(libAVFilter *this, wchar_t **info)
{
dshowdebug("libAVFilter_QueryVendorInfo(%p)\n", this);
if (!info)
return E_POINTER;
*info = wcsdup(L"libAV");
return S_OK;
}
| 18,455 |
FFmpeg | 7da9f4523159670d577a2808d4481e64008a8894 | 1 | static int compute_mb_distortion(CinepakEncContext *s, AVPicture *a, AVPicture *b)
{
int x, y, p, d, ret = 0;
for(y = 0; y < MB_SIZE; y++) {
for(x = 0; x < MB_SIZE; x++) {
d = a->data[0][x + y*a->linesize[0]] - b->data[0][x + y*b->linesize[0]];
ret += d*d;
}
... | 18,456 |
qemu | 5e52e5f903b2648c59030637e1610b32e965d615 | 1 | static VirtIOSerialBus *virtser_bus_new(DeviceState *dev)
{
VirtIOSerialBus *bus;
bus = FROM_QBUS(VirtIOSerialBus, qbus_create(&virtser_bus_info, dev, NULL));
bus->qbus.allow_hotplug = 1;
return bus;
}
| 18,458 |
FFmpeg | ac4b32df71bd932838043a4838b86d11e169707f | 1 | static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
int jobnr, int threadnr)
{
VP8Context *s = avctx->priv_data;
VP8ThreadData *td = &s->thread_data[jobnr];
VP8ThreadData *next_td = NULL, *prev_td = NULL;
VP8Frame *curframe = s->curframe;
... | 18,459 |
FFmpeg | 6e42e6c4b410dbef8b593c2d796a5dad95f89ee4 | 1 | void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
{
long i;
for(i=0; 3*i<src_size; i++)
{
#ifdef WORDS_BIGENDIAN
/* RGB24 (= R,G,B) -> BGR32 (= A,R,G,B) */
dst[4*i + 0] = 0;
dst[4*i + 1] = src[3*i + 0];
dst[4*i + 2] = src[3*i + 1];
dst[4*i + 3] = src[3*i + 2];
#else
... | 18,460 |
FFmpeg | f772b7fa7d57cba2e81727c7af29110f9556f06f | 1 | static int ea_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
EaDemuxContext *ea = s->priv_data;
ByteIOContext *pb = s->pb;
int ret = 0;
int packet_read = 0;
unsigned int chunk_type, chunk_size;
int key = 0;
int av_uninit(num_samples);
while (!packe... | 18,461 |
FFmpeg | 4d7d9a57825ee7a6394d361b5c5b6f16422b361c | 0 | static void decode_interframe_v4a(AVCodecContext *avctx, uint8_t *src,
uint32_t size)
{
Hnm4VideoContext *hnm = avctx->priv_data;
GetByteContext gb;
uint32_t writeoffset = 0, offset;
uint8_t tag, count, previous, delta;
bytestream2_init(&gb, src, size);
... | 18,463 |
FFmpeg | 7a7b1f5c4d4127ff78bed67e786d03560a9cc199 | 0 | static void roqvideo_decode_frame(RoqContext *ri)
{
unsigned int chunk_id = 0, chunk_arg = 0;
unsigned long chunk_size = 0;
int i, j, k, nv1, nv2, vqflg = 0, vqflg_pos = -1;
int vqid, bpos, xpos, ypos, xp, yp, x, y, mx, my;
int frame_stats[2][4] = {{0},{0}};
roq_qcell *qcell;
const u... | 18,465 |
FFmpeg | fc9b22dd2e5de851a89245b5357e710b93587278 | 0 | static void build_udp_url(char *buf, int buf_size,
const char *hostname, int port,
int local_port, int ttl)
{
snprintf(buf, buf_size, "udp://%s:%d", hostname, port);
if (local_port >= 0)
url_add_option(buf, buf_size, "localport=%d", local_port);
... | 18,466 |
FFmpeg | ddad09397247f523d7cc66c7f4ed7ea6894cc40e | 0 | static av_cold int wavpack_encode_init(AVCodecContext *avctx)
{
WavPackEncodeContext *s = avctx->priv_data;
s->avctx = avctx;
if (!avctx->frame_size) {
int block_samples;
if (!(avctx->sample_rate & 1))
block_samples = avctx->sample_rate / 2;
else
... | 18,467 |
FFmpeg | 72237ef6e933527be7855cb266a2a4df4dcb8096 | 0 | static int sub2video_prepare(InputStream *ist)
{
AVFormatContext *avf = input_files[ist->file_index]->ctx;
int i, w, h;
/* Compute the size of the canvas for the subtitles stream.
If the subtitles codec has set a size, use it. Otherwise use the
maximum dimensions of the video streams i... | 18,468 |
qemu | 599d64f6dc10f267a45e7abebfcafd8e7626585b | 1 | static int arm946_prbs_read(CPUARMState *env, const ARMCPRegInfo *ri,
uint64_t *value)
{
if (ri->crm > 8) {
return EXCP_UDEF;
}
*value = env->cp15.c6_region[ri->crm];
return 0;
}
| 18,469 |
FFmpeg | 20c86571ccc71412781d4a4813e4693e0c42aec6 | 1 | static int compat_read(AVFilterContext *ctx, AVFilterBufferRef **pbuf, int nb_samples)
{
AVFilterBufferRef *buf;
AVFrame *frame;
int ret;
if (!pbuf)
return ff_poll_frame(ctx->inputs[0]);
frame = av_frame_alloc();
if (!frame)
return AVERROR(ENOMEM);
if (!nb_sam... | 18,470 |
qemu | 12de9a396acbc95e25c5d60ed097cc55777eaaed | 1 | int cpu_ppc_register (CPUPPCState *env, ppc_def_t *def)
{
env->msr_mask = def->msr_mask;
env->mmu_model = def->mmu_model;
env->excp_model = def->excp_model;
env->bus_model = def->bus_model;
env->bfd_mach = def->bfd_mach;
if (create_ppc_opcodes(env, def) < 0)
return -1;
init_... | 18,471 |
qemu | 2f448e415f364d0ec4c5556993e44ca183e31c5c | 1 | static uint64_t unin_data_read(void *opaque, hwaddr addr,
unsigned len)
{
UNINState *s = opaque;
PCIHostState *phb = PCI_HOST_BRIDGE(s);
uint32_t val;
val = pci_data_read(phb->bus,
unin_get_config_reg(phb->config_reg, addr),
... | 18,473 |
qemu | 398489018183d613306ab022653552247d93919f | 1 | static void pc_fw_cfg_guest_info(PcGuestInfo *guest_info)
{
PcRomPciInfo *info;
if (!guest_info->has_pci_info || !guest_info->fw_cfg) {
return;
}
info = g_malloc(sizeof *info);
info->w32_min = cpu_to_le64(guest_info->pci_info.w32.begin);
info->w32_max = cpu_to_le64(guest_info->... | 18,475 |
qemu | 4f298a4b2957b7833bc607c951ca27c458d98d88 | 1 | static void set_sel_time(IPMIBmcSim *ibs,
uint8_t *cmd, unsigned int cmd_len,
uint8_t *rsp, unsigned int *rsp_len,
unsigned int max_rsp_len)
{
uint32_t val;
struct ipmi_time now;
IPMI_CHECK_CMD_LEN(6);
val = cmd[2] | (c... | 18,476 |
qemu | e0e2d644096c79a71099b176d08f465f6803a8b1 | 1 | static inline void vring_used_write(VirtQueue *vq, VRingUsedElem *uelem,
int i)
{
VRingMemoryRegionCaches *caches = atomic_rcu_read(&vq->vring.caches);
hwaddr pa = offsetof(VRingUsed, ring[i]);
virtio_tswap32s(vq->vdev, &uelem->id);
virtio_tswap32s(vq->vdev, &ue... | 18,478 |
qemu | 187337f8b0ec0813dd3876d1efe37d415fb81c2e | 1 | static void integratorcm_init(int memsz, uint32_t flash_offset)
{
int iomemtype;
integratorcm_state *s;
s = (integratorcm_state *)qemu_mallocz(sizeof(integratorcm_state));
s->cm_osc = 0x01000048;
/* ??? What should the high bits of this value be? */
s->cm_auxosc = 0x0007feff;
s->c... | 18,479 |
FFmpeg | 428098165de4c3edfe42c1b7f00627d287015863 | 1 | static int mlib_YUV2ARGB420_32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
if(c->srcFormat == PIX_FMT_YUV422P){
srcStride[1] *= 2;
srcStride[2] *= 2;
}
assert(srcStride[1] == srcStride[2]);
mlib_VideoColorYUV2A... | 18,480 |
FFmpeg | 6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef | 1 | int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt, int is_vp7)
{
VP8Context *s = avctx->priv_data;
int ret, i, referenced, num_jobs;
enum AVDiscard skip_thresh;
VP8Frame *av_uninit(curframe), *prev_frame;
if (is_vp7)
ret = vp7_deco... | 18,482 |
qemu | 5e54769c921a3d8cd8858444f5a3fa62cc44260e | 1 | static void execute_async(DWORD WINAPI (*func)(LPVOID), LPVOID opaque,
Error **errp)
{
Error *local_err = NULL;
if (error_is_set(errp)) {
return;
}
HANDLE thread = CreateThread(NULL, 0, func, opaque, 0, NULL);
if (!thread) {
error_set(&local_err, ... | 18,483 |
qemu | c5a49c63fa26e8825ad101dfe86339ae4c216539 | 1 | static void spr_read_tbu(DisasContext *ctx, int gprn, int sprn)
{
if (ctx->tb->cflags & CF_USE_ICOUNT) {
gen_io_start();
}
gen_helper_load_tbu(cpu_gpr[gprn], cpu_env);
if (ctx->tb->cflags & CF_USE_ICOUNT) {
gen_io_end();
gen_stop_exception(ctx);
}
}
| 18,484 |
FFmpeg | dfa920807494f0bc505aa090e036b531daa604ad | 1 | static void vector_fmul_window_mips(float *dst, const float *src0,
const float *src1, const float *win, int len)
{
int i, j;
/*
* variables used in inline assembler
*/
float * dst_i, * dst_j, * dst_i2, * dst_j2;
float temp, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
... | 18,485 |
FFmpeg | 3d7817048cb387de87600f2152075f78b37b60a6 | 1 | static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth,
unsigned size)
{
unsigned i, j;
CodeBook cb = { 0 };
if (!can_safely_read(gb, size * 34))
return cb;
if (size >= INT_MAX / sizeof(MacroBlock))
return cb;
cb.blocks = av_ma... | 18,486 |
FFmpeg | c3ab0004ae4dffc32494ae84dd15cfaa909a7884 | 1 | static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW, int xInc,
const int16_t *filter, const int16_t *filterPos, int filterSize)
{
#if COMPILE_TEMPLATE_MMX
assert(filterSize % 4 == 0 && filterSize>0);
if (filterSize==4) { // Always true fo... | 18,487 |
FFmpeg | 77d88b872d8cbb42738ede2d4fc098c16f204236 | 1 | YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE)
YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE)
YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE)
YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE)
static av_always_inline void
yuv2rgb_write(uint8_t *_dest, int i, int Y1, int... | 18,489 |
qemu | 4f4321c11ff6e98583846bfd6f0e81954924b003 | 1 | static void musb_rx_packet_complete(USBPacket *packey, void *opaque)
{
/* Unfortunately we can't use packey->devep because that's the remote
* endpoint number and may be different than our local. */
MUSBEndPoint *ep = (MUSBEndPoint *) opaque;
int epnum = ep->epnum;
MUSBState *s = ep->musb;
... | 18,490 |
qemu | 24df3371d97a7516605aef8abbc253a8c162b211 | 1 | static int process_requests(int sock)
{
int flags;
int size = 0;
int retval = 0;
uint64_t offset;
ProxyHeader header;
int mode, uid, gid;
V9fsString name, value;
struct timespec spec[2];
V9fsString oldpath, path;
struct iovec in_iovec, out_iovec;
in_iovec.iov_ba... | 18,491 |
FFmpeg | 8cd1c0febe88b757e915e9af15559575c21ca728 | 1 | static av_cold int pcx_init(AVCodecContext *avctx) {
PCXContext *s = avctx->priv_data;
avcodec_get_frame_defaults(&s->picture);
avctx->coded_frame= &s->picture;
return 0;
}
| 18,492 |
FFmpeg | 77bc507f6f001b9f5fa75c664106261bd8f2c971 | 1 | static void find_compressor(char * compressor_name, int len, MOVTrack *track)
{
AVDictionaryEntry *encoder;
int xdcam_res = (track->par->width == 1280 && track->par->height == 720)
|| (track->par->width == 1440 && track->par->height == 1080)
|| (track->par->width == 192... | 18,494 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | const char *print_wrid(int wrid)
{
if (wrid >= RDMA_WRID_RECV_CONTROL) {
return wrid_desc[RDMA_WRID_RECV_CONTROL];
}
return wrid_desc[wrid];
}
| 18,495 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.